Convert Button component to on/off switch

Is it possible to use a button component as on/off
switch so that I press the button and an image disappears ( set image invisible ), and I press the same button again and it appears (set image visible), and so on..

Because I want to change the shape of the button and I do not want to use the switch shape

1 Like

Yes you can change button's shape or picture when pressed.

1 Like

You can also change the button text between ON and OFF.

1 Like

No i want to make a button like this video

When i click collapse text paragragh or images or any components and also i can easily control the button icon

1 Like

Create a variable called xstatus initially set to FALSE
When button is clicked, reverse the value
of xstatus. Ie.
Xstatus= NOT(xstatus)

You can interrogate xtatus like this

If xstatus=TRUE
Set bkgd to green
Else
Set bkgd to red

1 Like

var2

worked ### thank you

1 Like

To simplify your code

bild

P.S. The HorizontalArrangement is set to visible=false

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.