Resize PowerScript function
Description
Resizes an object or control by setting its Width and Height
properties and then redraws the object.
Controls
Any object, except a child DataWindow
Syntax
|
1 |
<span>objectname</span>.<span>Resize</span> ( <span>width</span>, <span>height</span> ) |
|
Argument |
Description |
|---|---|
|
objectname |
The name of the object or control you |
|
width |
The new width in PowerBuilder units |
|
height |
The new height in PowerBuilder units |
Return Values
Integer. Returns 1 if it succeeds and
-1 if an error occurs or if objectname is a minimized
or maximized window. If any argument’s value is null, Resize returns null.
Usage
You cannot use Resize for a child DataWindow.
Resize does not resize a minimized or maximized
sheet or window. If the window is minimized or maximized, Resize returns –1.
Equivalent syntax
You can set object’s Width and Height properties
instead of calling the Resize function. However,
the two statements cause PowerBuilder to redraw objectname twice;
first with the new width, and then with the new width and height.
|
1 |
<span>objectname</span>.Width = <span>width</span> |
|
1 |
<span>objectname</span>.Height = <span>height</span> |
The first two statements, although they redraw gb_box1 twice,
achieve the same result as the third statement:
|
1 |
gb_box1.Width = 100 // These lines resize <br>gb_box1.Height = 150 // gb_box1 to 100 x 150<br>gb_box1.<span>Resize</span>(100, 150)// So does this line |
Examples
This statement changes the Width and Height properties
of gb_box1 and redraws gb_box1 with
the new properties:
|
1 |
gb_box1.<span>Resize</span>(100, 150) |
This statement doubles the width and height of the
picture control p_1:
|
1 |
p_1.<span>Resize</span>(p_1.Width*2, p_1.Height*2) |