DropDown Event

See AlsoQULP6Q              Example299UAY6>Low

Applies To

Combo box1YZXFF6.

Description

Occurs when the list portion of a combo box is about to drop down; this event does not occur if a combo box's Style1L09GO8 property is set to 1 (Simple Combo).

Syntax

Sub ctlname_DropDown (Index As Integer)

Remarks

The argument Index uniquely identifies a control if it is in a control array8G7Y0UU.  Use a DropDown procedure to make final updates to a combo box list before the user makes a selection.  This allows you to add or remove items from the list, using the AddItem2BIX3OB or RemoveItemM867OS methods.  This flexibility is useful when you want some interplay between controlsfor example, if what you want to load into a combo box list depends on what the user selects in an option button group.


See Also

Help:

Style Property1L09GO8

 

Programmer's Guide:

Chapter 12, "Responding to Mouse Events"


DropDown Event Example

The example updates a combo box 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 combo box and two option buttons.  Set the Name property of both option buttons to OptionGroup.  Then press F5 and click the option buttons.  The combo box reflects different carriers depending on the option button selected.

Sub Form_Load ()

   Combo1.Text = ""                      ' Clear combox box.

End Sub

 

Sub Combo1_DropDown ()

   While Combo1.ListCount                ' Delete existing items.

      Combo1.RemoveItem 0

   Wend

   If OptionGroup(0).Value = True Then

      Combo1.AddItem "Gray Goose Express", 0

      Combo1.AddItem "Wild Fargo Carriers", 1

   Else

      Combo1.AddItem "Pegasus Overnight"

   End If

End Sub