CONTROL SET CLIENT statement  

Purpose

Change the size of a control to a specific client area size.

Syntax

CONTROL SET CLIENT hDlg, id&, nWide&, nHigh&

Remarks

Client size may be smaller than total size, depending on the type of borders used. The client area is the part inside the borders of a control, which varies depending upon the style and exstyle at creation. In a control without borders, the client size and total size is the same. As an alternate example, a control with the %WS_BORDER style will typically have a client area a few pixels smaller than the total size.

hDlg

Handle of the dialog that owns the control.

id&

The unique control identifier, assigned to the control with the CONTROL ADD statement.

nWide&, nHigh&

Integral expressions, variables, or numeric literal values, specifying the desired size of the client area. Width and height are specified in pixels or dialog units, depending upon the system used when the parent dialog was created.

Graphic Controls

Beginning with this version of PowerBASIC, GRAPHIC CONTROLS may be resized with CONTROL SET CLIENT, GRAPHIC SET CLIENT, CONTROL SET SIZE, and GRAPHIC SET SIZE.

When you change the size of a graphic control, the original bitmap is copied, pixel for pixel, to the newly resized control.  Any expanded area is filled with the current background color.  Your program draws to it in the normal fashion for a bitmap of the new size.

If a clip area had been established to create margins, it is reset.  If scaled coordinates had been established, they are also reset, as neither would be appropriate for the altered size.  You can enable these attributes again with GRAPHIC SCALE or GRAPHIC SET CLIP, based upon the new size of the drawing area.

See also

Dynamic Dialog Tools, CONTROL GET CLIENT, CONTROL GET LOC, CONTROL GET SIZE, CONTROL SET LOC, CONTROL SET SIZE, GRAPHIC SET CLIENT, GRAPHIC SET SIZE