Position and size properties

Position and Size

The first set of fields on the Position and Size tab are used to set the position (origin) and size of the control or dialog. For dialogs, the Top and Left fields are relative to the top/left corner of the desktop, whereas for controls, this is relative to the top/left corner of the client area of the parent dialog. All measurements are set in dialog units.

The second set of fields show the equivalent measurements in pixels. The pixel fields are informational only, since the pixel values are specific to the screen resolution and font setup of the PC being used for development.

Favorite Sizes

The Position and Size tab also offers a Favorite Sizes selection (just like the Styles properties page described above), and this works in an identical manner, allowing the creation and maintenance of sets of favorites sizes for controls and dialogs. This is designed to help ensure that application dialogs are created with a consistent appearance.

The Left and Top position values in the default Favorite Sizes set are only applied to newly created dialogs, and when applying a Favorite Sizes set to the current dialog. Once created, dialogs are not "locked" to the default position, and may be moved around in the design mode or by manually editing the Position fields in the Properties dialog.

The default Favorite Sizes Width and Height is applicable to controls added to a dialog using the Toolbox double-click method.

Dialog coordinates

PBForms supports code generation for DIALOG NEW with the optional PIXELS mode introduced in PB/Win 8.0. The default (and recommended) mode is Dialog Units. Note that the PIXELS option applies to import/read, save, and code preview only, with appropriate coordinate conversion between Dialog Units and Pixels when needed. Design-mode coordinates are always shown as Dialog Units.


See Also

Dialog and control properties

General properties

Control Colors

Styles properties

OK, cancel, and apply buttons