JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Setting a Radio Button's State

Besides examining a radio button's state, you also can set it using the Checked property. The Checked property can take two values, True or False. Here's an example. In this case, we just set a radio button, RadioButton1, to its selected state by setting its Checked property to True:

Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
    RadioButton1.Checked = True
End Sub

And that's all it takes.

Tip 

How can you make a radio button appear checked when your program first starts? Just set its Checked property to True at design time.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor