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) If rb.Checked Then rb.BackColor = Color.Yellow Else rb.BackColor = SystemColors.Control End If End Sub




Reply With Quote