Style Property

Specifies the style for a control. Read/write at design and run time.


[Form.]Control.Style [= nType]

nType

Specifies a numerical value that determines the style of a control.

For CheckBox and OptionButton controls, the following table lists the values for nType.

nType

Description

0   

Standard (Default)

1   

Graphical.

The button appears like a command button and can contain both graphics and text. When the button contains both, the position of the text and graphic is determined by the PicturePosition property. For more information, see PicturePosition Property.

For ComboBox controls, the following table lists the values for nType.

nType

Description

0   

Drop-down combo box, which includes a list box and an edit box. (Default)

The user can select from the list box or type characters in the edit box.

2   

Drop-down list box.

The user must select items from the list box.

To decide which setting to choose for combo boxes, follow these guidelines:

  • To provide a list of choices and allow the user to type a selection in the edit box, set Style to 0 (drop-down combo box). This setting saves space on a form because the list box closes when the user makes a selection.

  • To display a fixed list of choices that the user can select an item from, set Style to 2 (drop-down list box). The list box closes when the user selects an item.

For CommandButton controls, the following table lists the values for nType.

nType

Description

0   

Standard (Default)

1   

Invisible

For TextBox controls, the following table lists the values for nType.

nType

Description

0   

Normal (Default)

1   

Included for backward compatibility with the FoxPro version 2.x @ ... SAY command. The text box is read-only and cannot receive focus.

For toolbar Separator objects, the following table lists the values for nType.

nType

Description

0   

Normal (Default).

No vertical or horizontal line appears as the separator object in toolbars.

1   

Specifies that a vertical or horizontal line appears as the separator object in toolbars and is visible at run time only.

When the toolbar displays horizontally, the line appears vertically. When the toolbar displays vertically, the line appears horizontally.

Note:

In versions prior to Visual FoxPro 9.0, undocked vertical system and user-defined toolbars did not display horizontal separators. However, horizontal separators now display for vertical undocked toolbars.

For Label and Shape controls, and Container and Control objects, the following table lists the values for nType.

nType

Description

0   

Normal (Default)

3   

Themed

On a Label control, Style controls the color of the text. You can use this setting for captions on group boxes that surround other controls. If the themed label is hosted in a Container, you may also need to set the Container's Style to 3. If Themes is enabled for a label, Visual FoxPro disregards the Enabled and FontCharSet properties. For more information, see Enabled Property and FontCharSet Property.

On a Shape control, Container or Control object, Style controls the color and style of the border. You can use this setting for borders on group boxes that surround other controls. If Themes is turned on for a Shape control, Visual FoxPro disregards the Curvature property. For more information, see Curvature Property.

If an operating system does not support Windows XP Themes, or if Themes is turned off, Visual FoxPro uses the settings for other properties such as SpecialEffect. For more information, see SpecialEffect Property.

4

Themed background only

On Label controls, Style controls the color of the background only. The label's background color is the same color as the label's parent container. You can use this setting primarily for labels on themed pages.

This setting is not supported for Shape controls, Container, and Control objects.

Community Additions

Show: