Moving and resizing controls – PB Docs 70

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.

proc.gif To use the grid:

  1. Choose Design>Options from the
    menu bar and select the General tab.

    The General property page displays.

    Ctl04.gif

  2. 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

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

note.gif 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.

proc.gif To align controls:

  1. Select the control whose position you want
    to use to align the others.

    PowerBuilder displays handles around the selected control.

  2. 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.

  3. Select Format>Align from the menu bar.

    or

    Select the Layout dropdown toolbar in the PainterBar.

  4. Select the dimension along which you want to align
    the controls.

    PowerBuilder aligns all the selected controls with the first
    one.

note.gif 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.

proc.gif To equalize the space between controls:

  1. Select the two controls whose spacing is
    correct.

    To do so, select one control, then press and hold ctrl and
    click the second control.

  2. Select the other controls whose spacing you want
    to be the same as the first two controls by pressing ctrl and
    clicking.

  3. Select Format>Space from the menu bar.

    or

    Select the Layout dropdown toolbar in the PainterBar.

  4. 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.

proc.gif To equalize the size of controls:

  1. Select the control whose size is correct.

  2. Select the other controls whose size you want
    to match the first control by pressing and holding ctrl and
    clicking.

  3. Select Format>Size from the menu bar.

    or

    Select the Layout dropdown toolbar in the PainterBar.

  4. Select the size for width, height, or both width
    and height.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x