DropButtonStyle Property

Applies To

ComboBox control, TextBox control.

Description

Specifies the symbol displayed on the drop button in a ComboBox.

Syntax

object.DropButtonStyle [= fmDropButtonStyle]

The DropButtonStyle property syntax has these parts:

Part

Description

object

Required. A valid object.

fmDropButtonStyle

Optional. The appearance of the drop button.


Settings

The settings for fmDropButtonStyle are:

Constant

Value

Description

fmDropButtonStylePlain

0

Displays a plain button, with no symbol.

fmDropButtonStyleArrow

1

Displays a down arrow (default).

fmDropButtonStyleEllipsis

2

Displays an ellipsis (¼).

fmDropButtonStyleReduce

3

Displays a horizontal line like an underscore character.


Remarks

The recommended setting for showing items in a list is fmDropButtonStyleArrow. If you want to use the drop button in another way, such as to display a dialog box, specify fmDropButtonStyleEllipsis, fmDropButtonStylePlain, or fmDropButtonStyleReduce and trap the DropButtonClick event.

See Also

DropButtonClick event, DropDown method, ShowDropButtonWhen property.

Example

The following example demonstrates the different symbols that you can specify for a drop-down arrow in a ComboBox or TextBox. In this example, the user chooses a drop-down arrow style from a ComboBox. This example also uses the Locked property. To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A ComboBox named ComboBox1.
  • A Label named Label1.
  • A TextBox named TextBox1 placed beneath Label1.
    Private Sub ComboBox1_Click()
        ComboBox1.DropButtonStyle = ComboBox1.Value
        TextBox1.DropButtonStyle = ComboBox1.Value
    End Sub
    
    Private Sub UserForm_Initialize()
        ComboBox1.ColumnCount = 2
        ComboBox1.BoundColumn = 2
        ComboBox1.TextColumn = 1
        
        ComboBox1.AddItem "Blank Button"
        ComboBox1.List(0, 1) = 0
        ComboBox1.AddItem "Down Arrow"
        ComboBox1.List(1, 1) = 1
        ComboBox1.AddItem "Ellipsis"
        ComboBox1.List(2, 1) = 2
        ComboBox1.AddItem "Underscore"
        ComboBox1.List(3, 1) = 3
        
        ComboBox1.Value = 0
        
        TextBox1.Text = "TextBox1"
        TextBox1.ShowDropButtonWhen = fmShowDropButtonWhenAlways
        TextBox1.Locked = True
        
        Label1.Caption = "TheDropButton also applies to a TextBox."
        Label1.AutoSize = True
        Label1.WordWrap = False
    End Sub