The setwindow statement specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).


This statement has five parameters:

top – top edge of the window.

left – left edge of the window.

height – height of the window.

width – width of the window.

options – is an item of text that optionally contains keywords that turn off elements of the new window. If the text contains NoToolBar (or NoPalette), the window will not have a tool bar. If the text contains NoScroll then the window will not have any scroll bars. If the text contains NoVerticalScroll, the window will not have a vertical scroll bar (this can also be abbreviated as novscroll or novertscroll). If the text contains NoHorizontalScroll, the window will not have a horizontal scroll bar (this can also be abbreviated as nohscroll or nohorzscroll). A procedure may combine several options separated by spaces. If the option text is empty (“”) the window will appear normal (the parameter can also be completely omitted, which also results in normal window appearance). Note: The keywords may be in either upper or lower case, for example, any of the keywords notoolbar, NoToolBar or NOTOOLBAR will eliminate the tool bar. The window location and options can now be set directly in most commands that open windows, making a separate setwindow statement unnecessary.


This statement specifies the dimensions (size and location) of the next window that is opened (with the openform, opensheet, openprocedure etc.). It can also specify window options, for example whether the tool bar or scroll bars should be included in the window.

When a new window opens it normally reappears in the same position it last appeared in. By using the setwindow statement before opening the window, the procedure can explicitly control where the window appears on the screen.

The procedure below opens the form Check List in a new window. The new window is the same size as the current window, but offset 10 points down and to the right. The new Check List window will not have a tool palette or horizontal scroll bar.

local newWindowRect
newWindowRect=rectangleadjust( info("windowrectangle"),10,10,10,10)
setwindow rtop(newWindowRect),rleft(newWindowRect),rheight(newWindowRect),rwidth(newWindowRect),"nopalette nohorzscroll"
openform "Check List"

The procedure below opens the form Balance Options as a 3 inch by 4 inch dialog box centered on the main screen. Notice that since the form is opened with the opendialog statement, the options parameter of the setwindowrectangle statement is ignored, so it has been omitted.

local newWindowRect
setwindow rtop(newWindowRect),rleft(newWindowRect),rheight(newWindowRect),rwidth(newWindowRect),""
opendialog "Balance Options"

Note: Panorama now allows the size and location to be specified directly in the the openform, openprocedure, opendialog and opendialogsheet statements – you no longer need a separate setwindow statement. You can also set the window options directly in the openform statement.

Note: This statement is obsolete, and should not be used in new applications. Use setwindowrectangle statement instead, or simply add additional parameters to the openform or other statements.

See Also


10.0No ChangeCarried over from Panorama 6.0.