ControlBox Property
Applies To
Form.
Description
You can use the ControlBox property to specify whether a form has a Control menu in Form view and Datasheet view.
Setting
The ControlBox property uses the following settings.
Setting | Description | Visual Basic |
|
Yes | (Default) The form has a Control menu in Form view and Datasheet view. | True (–1) |
No | The form doesn't have a Control menu in Form view and Datasheet view. | False (0) |
Note Setting the ControlBox property to No also removes the Minimize, Maximize, and Close buttons on a form.
You can set this property by using the form's property sheet, a macro, or Visual Basic.
You can set this property only in form Design view.
Remarks
To display a Control menu on a form, the ControlBox property must be set to Yes and the form's BorderStyle property must be set to Thin, Sizable, or Dialog.
Even when a form's ControlBox property is set to No, the form always has a Control menu when opened in Design view.
Setting the ControlBox property to No suppresses the Control menu when you:
- Open the form in Form view from the Database window.
- Open the form from a macro.
- Open the form from Visual Basic.
- Open the form in Datasheet view.
- Switch to Form view or Datasheet view from Design view.
See Also
BorderStyle property, CloseButton property, MinMaxButtons property, Modal property, PopUp property.
Example
The following example sets the ControlBox property on the WarningDialog form to False (0):
Forms!WarningDialog.ControlBox = False