List Property Example

This example loads a ComboBox control with a list of sandwich names and displays the first item in the list. To try this example, paste the code into the Declarations section of a form that contains a ComboBox control, and then press F5.

Private Sub Form_Load ()
   Combo1.AddItem "Denver Sandwich"   ' Add each item to list.
   Combo1.AddItem "Reuben Sandwich"
   Combo1.AddItem "Turkey Sandwich"
   Combo1.Text = Combo1.List(0)   ' Display first item.
End Sub