Option Buttons

 

An option button is another method that can offer options for the users to choose. However, it is different from the checkbox. The different is that the checkbox offers multiple choices which means the users can choose more than one choice while the option button allows only one choice at a time, checking one option button automatically unchecked the other option buttons. The syntax for checked button is  Optionbutton=True  and for unhecked button is Optionbutton1=False .Here is the program about T-shirt's size selection that illustrates the usage of option buttons:

Private Sub Command1_Click()
If optXXL = True Then
Lbl_Size.Caption = "XXL"
ElseIf OptXL = True Then
Lbl_Size.Caption = "XL"
ElseIf OptL = True Then
Lbl_Size.Caption = "L"
Else
Lbl_Size.Caption = "M"
End If
End Sub

 

 

 

 

 

 [Back to VBToday]