CONTROL SET LOC statement

Purpose | Move the control to a new location in the dialog.
Syntax | CONTROL SET LOC hDlg, id&, x&, y&

Remarks

hDlg refers to the dialog that owns the control.

id& is the unique control identifier as assigned to the control with a CONTROL ADD statement.

x& and y& specify the new location for the upper left corner of the control. These coordinates are relative to the upper left corner of the client area of the parent dialog (0,0), and are specified in the same terms (pixels or dialog units) as the parent dialog.

The location coordinates may be negative or larger than the width of the parent dialog's client area, causing the control to be clipped (partially displayed) or completely hidden.

This technique is often employed to capture the ENTER key, by creating a default button (%BS_DEFAULT) and positioning the control outside of the client area of the dialog - even though the control is not visible, it is still active and can respond to control accelerator keystrokes, etc.

See also | Dynamic Dialog Tools, CONTROL GET CLIENT, CONTROL GET LOC, CONTROL GET SIZE, CONTROL SET SIZE