abhi vs

abhi vs

  • NA
  • 6
  • 0

to keep the radiobuttons unchecked in form load

Jan 4 2010 4:57 PM
hi guys i have a form with 3 radiobuttons when i click on a radio button the backcolor of the form will be changed 

i have written a code like this:

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
        Me.BackColor = Color.Black

    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        Me.BackColor = Color.LightGreen
    End Sub

    Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton3.CheckedChanged
        Me.BackColor = Color.OrangeRed

    End Sub

    Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        RadioButton1.Checked = False
        RadioButton2.Checked = False
        RadioButton3.Checked = False

    End Sub


but when i try to debug the form is loading with the first radiobutton checked and also with the backcolor of the event.
i want my form to be plain when it loads and only it should change when i click radiobutton..


thanks


Answers (1)