SizeWindow

(Engine-Level Function)

Description: Changes the visible size of a window on the screen.
Returns: Nothing
Usage: Script or steady state.
Function Groups: Window
Related to: MoveWindow | WindowOptions
Format: SizeWindow(Win, Width, Height[, VirtualWidth, VirtualHeight])
Parameters:  
Win
Required. Any expression which gives an object value contained in the window to size. Often, Self().
Width
Required. Any numeric expression that gives the new width of the window.
Height
Required. Any numeric expression that gives the new height of the window.
VirtualWidth
Any numeric expression that gives the width inside the new window in user coordinates (which may be pixels). If VirtualWidth is larger than the client area specified, a horizontal scroll bar appears.
VirtualHeight
Any numeric expression that gives the height inside the new window in user coordinates (which may be pixels). If VirtualHeight is larger than the client area specified, a vertical scroll bar appears.
Comments:

This statement will change the size of the window to the size given. Any objects drawn in the window are not scaled - this resizing simply changes the area displayed. Vertical and horizontal scroll bars will be added to the window's borders so that the entire area can be viewed.
If either VirtualWidth or VirtualHeight are specified, then both must be provided. Attempting to set one without the other will cause the one you set to be ignored. If these parameters are omitted, the virtual size of the window will be changed to whatever value is in the Width and Height parameters.

Use with care in pages: your code will run when the page is displayed in the Idea Studio and when the Page Menu page shows a live preview, possibly with undesirable results in those situations. In a page, the trigger for this function should be a user action rather than anything that runs automatically.

Example:

If ZButton(25, 50, 145, 100, "Resize", 1);
[
  SizeWindow(Self(), 300, 500);
]

This will display a button in the upper left corner of the window that when pressed, re-sizes the window to be 300 pixels wide by 500 pixels high.