I am trying to highlight the background color of a button when it is pressed and can do this by the following:
cmd_low.BackColor = Color.Yellow
but i need to change it back to the default button color when another button is pressed (buttonface). any ideas?
I am trying to highlight the background color of a button when it is pressed and can do this by the following:
cmd_low.BackColor = Color.Yellow
but i need to change it back to the default button color when another button is pressed (buttonface). any ideas?
Hi,
Is it VB.Net 2003 or 2005!
There are some buttons to let you make a selection.
Any way It's the same for 2003 and 2005
Try this;
VB Code:
Button1.BackColor = Color.Red
Wkr,
sparrow1
Last edited by sparrow1; Jun 1st, 2006 at 04:52 PM.
Wkr,
sparrow1
If I helped you, don't forget to Rate my post. Thank you
So basically what you're trying to do is create RadioButton functionality with standard Buttons, correct? If so you would be much better off actually using RadioButton controls. They have an Appearance property that you can set to Button and they will look exactly like a regular Button except that they stay depressed when you click them. When you then click another RadioButton the previous one will popup again. The depressed state corresponds to the Checked property being True. If you want to add the extra visual cue of colour you can then just do this:
VB Code:
Private Sub RadioButton_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged, _
RadioButton2.CheckedChanged, _
RadioButton1.CheckedChanged
Dim rb As RadioButton = DirectCast(sender, RadioButton)