Style

This property returns and sets a value that indicates the display type and behavior of the control.

Syntax

object.Style

Parameters

object
Object expression that evaluates to a CheckBox, CommandButton, CommandBarButton, OptionButton, ComboBox, ListBox, or CommandBarComboBox object.

Following are the settings for the Style property for the Checkbox, CommandButton, CommandBarButton, and OptionButton controls:

0 (default)
Standard. The control displays as it did in previous versions of Visual Basic for Windows CE. That is, a Checkbox displays as a check box with a label next to it; an OptionButton displays as an option button with a label next to it; and a CommandButton displays as a standard CommandButton without an associated graphic. The CommandButton control does not support the Backcolor property when the setting for the Style property is 0.
1
Graphical. The control displays in a graphical style. That is, a Checkbox control appears similar to a CommandButton that the user can toggle up or down; an OptionButton appears similar to a CommandButton that remains toggled up or down until another OptionButton in its option group is selected; and a CommandButton displays as a standard CommandButton that also can display an associated graphic.

Following are the settings for the Style property for the ComboBox control:

0 (default)
Drop-down combo box. Includes a drop-down list and a text box. A user can select from the list or type in the text box.
1
Combo box. Includes a text box and a list, which does not drop down. A user can select from the list or type in the text box. The size of a combo box includes both the edit and list portions. By default, a combo box is sized so that none of the list is displayed. To display more of the list, increase the Height property.
2
Drop-down list box. This style enables selection only from a drop-down list.

Following is the setting for the Style property for the ListBox control:

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

The following table shows the settings for the Style property for the CommandBarButton object.
Constant
Value
Description
cbrAutoSize 5 Sizes the button based on the Caption property
cbrButtonGroup 2 Begins or ends a button group
cbrCheck 1 Toggles between a pressed and an un-pressed state, depending on the Value property
cbrDefault 0 Behaves as a standard CommandButton
cbrSeparator 3 Provides space between buttons and separates button groups

The following table shows the settings for the Style property for the CommandBarComboBox object.
Constant
Value
Description
cbrComboDropDown 2 Drop-down box with a textbox
cbrComboDropDownList 3 Drop-down box only

The following table lists the settings for the Style property for the Item object of a CommandBar control.
Constant
Value
Description
cbrMenuDefault 0 Menu caption is displayed
cbrMenuSeparator 1 Item is a menu separator

Remarks

The Style property is read-only at run time, except for the CommandBarButton, CommandBarComboBox, and CommandBarMenuBar.

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