CONTROL ADD HEADER statement  

Purpose

Add a header control to a dialog.

Syntax

CONTROL ADD HEADER, hDlg, ID, Txt$, x, y, wide, high [,style] [,exstyle] [,CALL CallBack]

Remarks

Handle of the dialog on which the header control will be placed.  The dialog will become the parent of the control.

ID

A unique numeric identifier for this control which is specified by the programmer.  It must be an integral value in the range of 1 to 65535. This ID is usually specified with a numeric equate for clarity of the code.  For example, the equate %IDC_HEADER1 is more informative than a literal value such as 497.  PowerBASIC recommends that identifier values should start at 100 to avoid conflict with any of the standard predefined identifiers.

Txt$

Text to associate with the Header control.  A Header control does not display this text, so it is common to set this value to a null, empty string literal ("" or $NUL).

x, y

Integral expressions which specify the location of the control within the dialog client area.  X is the horizontal position, and Y is the vertical position.  0,0 refers to the upper left corner of the Dialog. Coordinates are specified in the same terms (pixels or dialog units) as the parent dialog.

wide, high

Integral expressions which specify the overall width and height of the header area.

style

Optional primary style of the header control. This value can be a combination of the values below, combined together with the OR operator to form a bitmask.  If style is omitted, the default combination is %WS_CHILD OR %WS_VISIBLE.

%WS_CHILD

The control is a child window.

%WS_VISIBLE

The control is visible.

%WS_BORDER

Add a thin line border around the header control.

exstyle

Optional extended style of the header control.

callback

Optional name of a Callback Function that receives all %WM_COMMAND and %WM_NOTIFY messages for the control.  See the #MESSAGES metastatement to choose which messages will be received. If a callback for the control is not designated, you must create a dialog Callback Function to process messages from your control.

If the Callback Function processes a message, it should return TRUE (non-zero) to prevent the message being passed unnecessarily to the dialog callback (if one exists). The dialog callback should also return TRUE if the notification message is processed by that Callback Function. Otherwise, the DDT engine processes unhandled messages.

See Also

HEADER