I got it to work using a somewhat convoluted method …...
and that is the way I would have done it too...
great minds think alike!!!
but there has to be a more direct and simpler way to do this.
Yeah, you would think there would just be a color property of the button, like there is in B4A.
The kludgy way would be to add new color commands to the end of the string (where they will override earlier color commands) rather than to the beginning, eg:
Button1.Style = Button1.Style & " -fx-background-color: Blue;"
but then the Style property string will get longer and longer and longer and...
boom!
Another approach is: if life gives you lemons, make lemonade. You could write a Sub that adds or modifies a field within Button.Style, eg, if the color command was already present, it would change it from
-fx-background-color: Red; to
-fx-background-color: Blue; rather than adding a new color command. But you've already got the button color change working, and putting effort into writing that Sub isn't going to make the color change any better than it already is, so... perhaps save writing that Sub for a rainy day when you don't have better things to do