ZOrder

Places a specified Form, or control at the front or back of the z-order within its graphical level. Named arguments are not supported.

Syntax

object.ZOrder position

The parts of the ZOrder method syntax are described in the following table.

Part Description
object Optional. An object expression that evaluates to an object. If object is omitted, the form with the focus is assumed to be object.
position Optional. Integer indicating the position of object relative to other instances of the same object. If position is 0 or omitted, object is positioned at the front of the z-order. If position is 1, object is positioned at the back of the z-order.

Remarks

The z-order of objects can be set at design time by choosing the Bring To Front or Send To Back menu command from the Edit menu.

Three graphical layers are associated with forms and containers. The back layer is the drawing space where the results of the graphics methods are displayed. Next is the middle layer where graphical objects and Label controls are displayed. The front layer is where all nongraphical controls like CommandButton, CheckBox, or ListBox are displayed. Anything contained in a layer closer to the front covers anything contained in the layer(s) behind it. ZOrder arranges objects only within the layer where the object is displayed.