Button with Image

Hi everyone, I would like to play with the graphic part of my program. In a nutshell, I’m using Xojo to interface with Arduino via serial port. At this time, by clicking on the button, I can turn the LED on and off. Now, can I use an image instead of the button? I put a canvas and added the mousedown with Serial1.write (“ON”) the command to turn on the LED, but it doesn’t work. Then I would like, that when I click, the LED lights up, and changes image from green to red and vice versa. Possible? Tips?

Hi, the easiest way is to use two canvas and make them visible = true/false
Or use one and change the backdrop (red/green).

If I use MouseDown not works, why?

Did you return True ?

http://documentation.xojo.com/MouseDown_event

Hi @Peter Marx how do I superimpose the two images? Using visible true / false

Think more primitive in Xojo.
Push two canvas over each other and make one visible, or the other one