TopW Command

Purpose

Activates a window.

Syntax

TopW wh

wh:integer or Handle expression

Description

When several windows are opened, #n activates the window (0 to _maxInt) specified in n. If this window is covered by another, it is brought up to the front.

For a form created without a window number, TopW takes its window handle from the hWnd property.

The output is not redirected after a TopW. The output continues to go to the current active object (Form or Printer). The output can be redirected by Output =, Set Me =, or to a form using the Activate property.

TopW is synonym to the Form method ToTop.

A form brought to the top using TopW or ToTop will not be brought before a Form that has the OnTop property set.

Example

OpenW 1, 0, 0, 200, 100

Win_1.Caption = "Win/Form 1"

OpenW 2, 200, 0, 200, 100

Win_2.Caption = "Win/Form 2"

Win_2.AutoRedraw = 1

OpenW 3, 0, 100, 200, 100

Win_3.Caption = "Win/Form 3"

OpenW 40, 200, 100, 200, 100

Form(40).AutoRedraw = 1

Form(40).Caption = "Win/Form 40"

TopW # 2

Print "Result in Win 400"

Output = Win_2 ' or Win_2.Activate

Print "Result in Win 2"

Local a% : KeyGet a%

CloseW # 2

CloseW # 40

CloseW # 3

CloseW # 1

Remarks

Windows opened with a number above 31 are accessed using the name Form(number). For instance, OpenW 40 is used as Form(40).Activate and the events have the format Sub Form_Activated(Index%) where Index% specifies the number of the form.

See Also

SizeW, CloseW, MoveW, TitleW, FullW, ClearW, OpenW

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