Reputation: 10893
Highlight, just like when you hover over to the button, its being highlighted. But how do you retain the highlight when you have clicked the button?
Upvotes: 1
Views: 6127
Reputation:
To highlight a button you have to use two buttons.
Place one above the other.
On the mouse down event of the red_button:
red_button.sendtoback
faded_red_button.bringtofront
faded_redb_button.visible=true
On the mouse up event of the red_button:
faded_red_button.sendtoback
red_button.bringtofront
red_button.visible=true
Upvotes: 0
Reputation: 22168
If this is WPF or Silverlight, you can simply re-template the Button control, and change the "Normal" state to match the "MouseOver" state. Not sure what you're using though?
Upvotes: 1
Reputation: 942257
It is not much of a functional spec. When it is supposed to turn off? Anyhoo, use a CheckBox, set Appearance = Button, AutoSize = False, TextAlign = MiddleCenter.
Upvotes: 1
Reputation: 4141
I don't know exactly why do you need this behaviour, but maybe you could use another control instead of Button. You could use CheckBox, with the appearance of a button. You can change this appearance in the properties window of the checkbox.
If you don't want to use this option, just let me know :-)
Upvotes: 2