Hello, in cases like this, I usually use a gallery of buttons. Basically, I create a collection in this format:
This can be done in the OnStart of the application. Then, I create a gallery and add a button. In the Items property of the gallery, I set colMenuButtons
. In the button’s label, I use ThisItem.Label
, and for the Fill property, I set:
If(ThisItem.isSelected, ThisItem.selectedColor, ThisItem.defaultColor)
This way, I can change the color of the selected item.
To define the actions for each button, in the OnSelect property of the button, I use a Switch statement.
This is just one way to do it. Another way would be to create 4 color-specific variables for each button. In the Fill property of each button, you would use:
If(varButton1 = true And Or(varButton2,varButton3,varButton4) = false,ColorValue("colorSelectedHex"), ColorValue("colorDefaultHex"))
Make sure to reset the variables for the other buttons when one is selected.
I hope this helps!