Rectangle Members (Access)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

This object corresponds to a rectangle control. The rectangle control displays a rectangle on a form or report.

Events

Name

Description

Click

The Click event occurs when the user presses and then releases a mouse button over an object.

DblClick

The DblClick event occurs when the user presses and releases the left mouse button twice over an object within the double-click time limit of the system.

MouseDown

The MouseDown event occurs when the user presses a mouse button.

MouseMove

The MouseMove event occurs when the user moves the mouse.

MouseUp

The MouseUp event occurs when the user releases a mouse button.

Methods

Name

Description

Move

Moves the specified object to the coordinates specified by the argument values.

SizeToFit

You can use the SizeToFit method to size a control so it fits the text or image that it contains.

Properties

Name

Description

Application

You can use the Application property to access the active Microsoft Access Application object and its related properties. Read-only Application object.

BackColor

Gets or sets the interior color of the specified object. Read/write Long.

BackShade

Gets or sets the shade applied to the theme color in the BackColor property of the specified object. Read/write Single.

BackStyle

You can use the BackStyle property to specify whether a control will be transparent. Read/write Byte.

BackThemeColorIndex

Gets or sets a value that represents a color in the applied color theme associated with the BackColor property of the specified object. Read/write Long.

BackTint

Gets or sets the tint that is applied to the theme color in the BackColor property of the specified object. Read/write Single.

BorderColor

You can use the BorderColor property to specify the color of a control's border. Read/write Long.

BorderShade

Gets or sets the shade that is applied to the theme color in the BorderColor property of the specified object. Read/write Single.

BorderStyle

Specifies how a control's border appears.Read/write Byte.

BorderThemeColorIndex

Gets or sets a value that represents a color in the applied color theme associated with the BorderColor property of the specified object. Read/write Long.

BorderTint

Gets or sets the tint that is applied to the theme color in the BorderColor property of the specified object. Read/write Single.

BorderWidth

You can use the BorderWidth property to specify the width of a control's border. Read/write Byte.

ControlType

You can use the ControlType property in Visual Basic to determine the type of a control on a form or report. Read/write Byte.

DisplayWhen

You can use the DisplayWhen property to specify which of a form's controls you want displayed on screen and in print. Read/write Byte.

EventProcPrefix

Gets or sets the prefix portion of an event procedure name. Read/write String.

Height

Gets or sets the height of the specified object in twips. Read/write Integer.

HorizontalAnchor

Gets or sets an AcHorizontalAnchor constant that indicates how the rectangle is anchored horizontally within its layout. Read/write.

InSelection

You can use the InSelection property to determine or specify whether a control on a form in Design view is selected. Read/write Boolean.

IsVisible

You can use the IsVisible property in to determine whether a control on a report is visible. Read/write Boolean.

Left

You can use the Left property to specify an object's location on a form or report. Read/write Integer.

Name

You can use the Name property to specify or determine the string expression that identifies the name of an object. Read/write String.

OldBorderStyle

You can use this property to set or returns the unedited value of the BorderStyle property for a form or control. This property is useful if you need to revert to an unedited or preferred border style. Read/write Byte.

OnClick

Sets or returns the value of the On Click box in the Properties window. Read/write String.

OnDblClick

Sets or returns the value of the On Dbl Click box in the Properties window. Read/write String.

OnMouseDown

Sets or returns the value of the On Mouse Down box in the Properties window. Read/write String.

OnMouseMove

Sets or returns the value of the On Mouse Move box in the Properties window. Read/write String.

OnMouseUp

Sets or returns the value of the On Mouse Up box in the Properties window. Read/write String.

Parent

Returns the parent object for the specified object. Read-only.

Properties

Returns a reference to a control's Properties collection object. Read-only.

Section

You can identify these controls by the section of a form or report where the control appears. Read/write Integer.

SpecialEffect

You can use the SpecialEffect property to specify whether special formatting will apply to the specified object. Read/write Byte.

Tag

Stores extra information about a form, report, section, or control needed by a Microsoft Access application. Read/write String.

Top

You can use the Top property to specify an object's location on a form or report. Read/write Integer. .

VerticalAnchor

Gets or sets an AcVerticalAnchor constant that indicates how the specified rectangle is anchored vertically within its layout. Read/write.

Visible

Returns or sets whether the object is visible. Read/write Boolean.

Width

Gets or sets the width of the specified object in twips. Read/write Integer.