ZOrder method (Microsoft Forms)

Places the object at the front or back of the z-order.

Syntax

object. ZOrder( [ zPosition ] )

The ZOrder method syntax has these parts:

Part Description
object Required. A valid object.
zPosition Optional. A control's position, front or back, in the container's z-order.

Settings

The settings for zPosition are:

Constant Value Description
fmTop 0 Places the control at the front of the z-order. The control appears on top of other controls (default).
fmBottom 1 Places the control at the back of the z-order. The control appears underneath other controls.

Remarks

The z-order determines how windows and controls are stacked when they are presented to the user. Items at the back of the z-order are overlaid by closer items; items at the front of the z-order appear to be on top of items at the back. When the zPosition argument is omitted, the object is brought to the front.

In design mode, the Bring to Front or Send to Back commands set the z-order. Bring to Front is equivalent to using the ZOrder method and putting the object at the front of the z-order. Send to Back is equivalent to using ZOrder and putting the object at the back of the z-order.

This method does not affect content or sequence of the controls in the Controls collection.

Note

You can't undo or redo layering commands, such as Send to Back or Bring to Front. For example, if you select an object and click Move Backward on the shortcut menu, you won't be able to undo or redo that action.

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.