Canvas indexed

Hello friends,
For example, I have 8 indexed canvasses (CV(0…7)) representing pushbuttons with a text from 1 to 8.
They are painted red with a white border.
When I click on one I want to draw a yellow border to show it’s activated.
But when I click on different buttons, the previous ones remain with a yellow border.
If anyone has an idea how to solve this I would be very grateful.

  g.FillRect 0, 0, g.Width, g.Height
  if Index = Case_Nbr_Lettres_Select  Then
    g.ForeColor = clYellow
  else
    g.ForeColor = clWhite
  end if

You need to refresh all the other canvases.

1 Like

on “click”, after setting the Case_Nbr_Lettres_Select you have to refresh all the related canvas

How to refresh indexed canvases?

.Refresh does not works ?

https://documentation.xojo.com/api/user_interface/desktop/desktopcanvas.html#desktopcanvas-refresh

I am sorry Emile, I do not find how to refresh all canvas(s)es.

You have to do them one by one:

CV(0).refresh()
CV(1).refresh()
// etc

Thanks to you three.
I placed that in the MouseDown event and it works like a charm Tim!