Style

Returns or sets a value indicating the display type and behavior of the control. Read-only at run time.

Syntax

object.Style

The object placeholder represents an object expression that evaluates to an object.

Settings

The Style property settings for the Checkbox, CommandButton, and OptionButton controls are described in the following table.

Value Description
0 (Default) Standard. The control displays as it did in previous versions of Visual Basic. That is, a Checkbox control displays as a checkbox with a label next to it, an OptionButton as an option button with a label next to it, and a CommandButton as a standard CommandButton without an associated graphic.
1 Graphical. The control displays in a graphical style. That is, a Checkbox control displays as a CommandButton-like button which can be toggled either up or down, an OptionButton displays as a CommandButton-like button which remains toggled up or down until another OptionButton in its option group is selected, and a CommandButton displays as a standard CommandButton that can also display an associated graphic.

The Style property settings for the ComboBox control are described in the following table.

Value Description
0 (Default). Dropdown Combo. Includes a drop-down list and a text box. The user can select from the list or type in the text box.
1 Simple Combo. Includes a text box and a list, which does not drop down. The user can select from the list or type in the text box. The size of a Simple combo box includes both the edit and list portions. By default, a Simple combo box is sized so that none of the list is displayed. Increase the Height property to display more of the list.
2 Dropdown List. This style allows selection only from the drop-down list.

The Style property setting for the ListBox control is described in the following table.

Value Description
0 (Default) Standard. The ListBox control displays as it did in previous versions of Visual Basic, as a list of text items.

Remarks

For the ComboBox control, follow these guidelines in deciding which setting to choose: