ZOrder Method

Purpose

Places a specified Form, or Ocx control at the front or back of the z-order within its graphical level.

Syntax

object.ZOrder [position = 0]

object:Ocx Object
position:iexp

Description

The position parameter is optional, it indicates 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.

Example

OpenW 1, 10, 10, 300, 200 : TitleW 1, Win_1.Name : Win_1.AutoRedraw = 1

Ocx Command cmd(1) = "Put to Back", 10, 10, 120, 22

OpenW 2, 100, 100, 300, 200 : TitleW 2, Win_2.Name : Win_2.AutoRedraw = 1

Ocx Command cmd(2) = "Put to Back", 10, 10, 120, 22

Do : Sleep  : Until Win_1 Is Nothing Or Win_2 Is Nothing

CloseW 1 : CloseW 2

 

Sub cmd_Click(Index%)

If Index% = 1 Then Win_1.ZOrder 1

If Index% = 2 Then Win_1.ZOrder 0

EndSub

Remarks

The z-order of objects can be set at design time by choosing the Bring To Front or Send To Back context menu commands. (Right click on an object)

See Also

Form, Arrange

{Created by Sjouke Hamstra; Last updated: 25/10/2014 by James Gaite}