DropDown Event Example

This example updates a ComboBox control based on the user's selection in an option button group. To try this example, paste the code into the Declarations section of a form that contains a ComboBox control and two OptionButton controls. Set the Name property of both OptionButton controls to OptionGroup, and then press F5 and click the OptionButton controls. The ComboBox control reflects different carriers depending on the OptionButton selected.

Private Sub Form_Load ()
   Combo1.Text = ""   ' Clear combo box.
End Sub

Private Sub Combo1_DropDown ()
   Combo1.Clear            ' Delete existing items.
   If OptionGroup(0).Value = True Then
      Combo1.AddItem "Gray Goose Express", 0
      Combo1.AddItem "Wild Fargo Carriers", 1
   Else
      Combo1.AddItem "Summit Technologies Overnight"
   End If
End Sub