BorderStyle Property

Applies To   ActiveX control, Bound Object Frame control, Chart control, Check Box control, Combo Box control, Form, Image control, Label control, Line control, List Box control, Option Button control, Option Group control, Rectangle control, Subform/Subreport control, Text Box control, Unbound Object Frame control.

Description

Setting

For forms, the BorderStyle property uses the following settings.

Setting

Description

Visual Basic

None

The form has no border or related border elements.
The form isn't resizable.

0

Thin

The form has a thin border and can include any of the border elements. The form isn't resizable (the Size command on the Control menu isn't available). You often use this setting for pop-up forms. (If you want a form to remain on top of all Microsoft Access windows, you must also set its PopUp property to Yes.)

1


(continued)

Sizable

(Default) The form has the default border for Microsoft Access forms, can include any of the border elements, and can be resized. You often use this setting for normal Microsoft Access forms.

2

Dialog

The form has a thick (double) border and can include only a title bar, a Close button, and a Control menu. The form can't be maximized, minimized, or resized (the Maximize, Minimize, and Size commands aren't available on the Control menu). You often use this setting for custom dialog boxes. (If you want a form to be modal, however, you must also set its Modal property to Yes. If you want it to be a modal pop-up form, which dialog boxes typically are, you must set both its PopUp and Modal properties to Yes.)

3


You can set the BorderStyle property for a form only in form Design view by using the form's property sheet, a macro, or Visual Basic.

For controls, the BorderStyle property uses the following settings.

Setting

Description

Visual Basic

Transparent

(Default only for label, chart, and subreport) Transparent

0

Solid

(Default) Solid line

1

Dashes

Dashed line

2

Short dashes

Dashed line with short dashes

3

Dots

Dotted line

4

Sparse dots

Dotted line with dots spaced far apart

5

Dash dot

Line with a dash-dot combination

6

Dash dot dot

Line with a dash-dot-dot combination

7


You can set the BorderStyle property for a control by using the control's property sheet, a macro, or Visual Basic.

You can set the default for this property by using a control's default control style or the DefaultControl method in Visual Basic.

Remarks

A control's border style is visible only when its SpecialEffect property is set to Flat or Shadowed. If the SpecialEffect property is set to something other than Flat or Shadowed, setting the BorderStyle property changes the SpecialEffect property setting to Flat.

For a form, the BorderStyle property establishes the characteristics that visually identify the form as a normal form, a pop-up form, or a custom dialog box. You may also set the Modal and PopUp properties to further define the form's characteristics.

You may also want to set the form's ControlBox, CloseButton, MinMaxButtons, ScrollBars, NavigationButtons, and RecordSelectors properties. These properties interact in the following ways:

  • If the BorderStyle property is set to None or Dialog, the form doesn't have Maximize or Minimize buttons, regardless of its MinMaxButtons property setting.
  • If the BorderStyle property is set to None, the form doesn't have a Control menu, regardless of its ControlBox property setting.
  • The BorderStyle property setting doesn't affect the display of the scroll bars, navigation buttons, the record number box, or record selectors.
The BorderStyle property takes effect only in Form view. The property setting is ignored in form Design view.

If you set the BorderStyle property of a pop-up form to None, you won't be able to close the form unless you put a Close button on it that runs a macro containing the Close action or an event procedure in Visual Basic that uses the Close method.

Pop-up forms are typically fixed in size, but you can make a pop-up form sizable by setting its PopUp property to Yes and its BorderStyle property to Sizable.

You can also use the Dialog setting of the Window Mode action argument of the OpenForm action to open a form with its Modal and PopUp properties set to Yes.

See Also   BackStyle property, BorderColor property, BorderWidth property, ControlBox property, ForeColor property, MinMaxButtons property, Modal property, PopUp property, SpecialEffect property.