Moving and resizing controls
In the Layout view, you can move or resize a control using
the mouse or the keyboard.
Using the mouse
To move a control, drag it with the mouse to where you want
it.
To resize a control, select it, then grab an edge and drag
it with the mouse.
Using the keyboard
To move a control, select it, then press an arrow key to move
it in the corresponding direction.
To resize a control, select it, and then :
To make the control | Press |
---|---|
Wider | shift+right arrow |
Narrower | shift+left arrow |
Taller | shift+down arrow |
Shorter | shift+up arrow |
Using the grid
The Window painter provides a grid to help you align controls.
To use the grid:
-
Choose Design>Options from the
menu bar and select the General tab.The General property page displays.
-
Use the grid options to:
- Make controls snap
to a grid position when you place them or move them in a window - Show or hide the grid when the workspace displays
- Specify the height and width of the grid cells
- Make controls snap
The grid options are:
Option | Meaning |
---|---|
Snap to Grid | If selected, controls are aligned with a horizontal and vertical grid line when you place or move them |
Show Grid | If selected, the grid is displayed in the workspace |
X | The width of each cell in the grid in pixels |
Y | The height of each cell in the grid in pixels |
Grid tips Window painting is slower when the grid is displayed, so you
may want to display the grid only when necessary.
Aligning controls
It is easy to align two or more controls.
To align controls:
-
Select the control whose position you want
to use to align the others.PowerBuilder displays handles around the selected control.
-
Press and hold the ctrl key
and click the controls you want to align with the first one.All the selected controls have handles on them.
-
Select Format>Align from the menu bar.
or
Select the Layout dropdown toolbar in the PainterBar.
-
Select the dimension along which you want to align
the controls.PowerBuilder aligns all the selected controls with the first
one.
Using the PainterBar You can select the Layout dropdown toolbar on the PainterBar
to align, space, or size controls.
Equalizing the space between controls
You can manually move controls by dragging them with the mouse.
You can also easily equalize the spacing around specified controls.
To equalize the space between controls:
-
Select the two controls whose spacing is
correct.To do so, select one control, then press and hold ctrl and
click the second control. -
Select the other controls whose spacing you want
to be the same as the first two controls by pressing ctrl and
clicking. -
Select Format>Space from the menu bar.
or
Select the Layout dropdown toolbar in the PainterBar.
- Select horizontal or vertical spacing.
Equalizing the size of controls
Assume you have several CommandButtons and want them to be
the same size. You can accomplish this manually or by using the
Edit menu.
To equalize the size of controls:
- Select the control whose size is correct.
-
Select the other controls whose size you want
to match the first control by pressing and holding ctrl and
clicking. -
Select Format>Size from the menu bar.
or
Select the Layout dropdown toolbar in the PainterBar.
-
Select the size for width, height, or both width
and height.