This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Create a new text box control inside a dialog.
A text box control is a rectangular control window typically used in a dialogs to permit the user to enter and edit text by typing on the keyboard.
Syntax
hndl = CONTROL ADD TEXTBOX [Name ControlName], hwnd, ctrlID, txt, xPos, yPos, Width, Height [, [Style] [, [ExStyle]]] [[,] CALL CallBack]
Returns
Number
Control window handler.
Parameters
Name |
Type |
Optional |
Meaning |
ControlName |
String |
Yes |
Optional name for the control.
This name must be globally unique, and is used to create a global variable to be used with control name methods and properties. |
hwnd |
Number |
No |
Handle of the dialog containing the control |
ctrlID |
Number |
No |
Control identifier |
txt |
String |
No |
A text expression representing the text you want to assign to the control. |
xPos |
Number |
No |
Horizontal position of the control inside the dialog |
yPos |
Number |
No |
Vertical position of the control inside the dialog |
Width |
Number |
No |
Control width |
Height |
Number |
No |
Control height |
Style |
Number |
Yes |
Primary style of the control. See TEXTBOX Style equates If no Style is specified, the following expression is assumed as default: %ES_AUTOHSCROLL OR %ES_LEFT OR %WS_BORDER OR %WS_TABSTOP |
ExStyle |
Number |
Yes |
Extended style of the control. See TEXTBOX ExStyle equates. If no Style is specified, the following expression is assumed as default: %WS_EX_CLIENTEDGE OR %WS_EX_LEFT |
CallBack |
Function |
Yes |
Optional name of a Callback Function that receives all %WM_COMMAND and %WM_NOTIFY messages for the 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. |
Remarks
The following notifications are sent to the Callback Function:
| %EN_CHANGE | Sent when the user has taken an action that may have altered text in the text box. Unlike the %EN_UPDATE notification, this message is sent after Windows updates the screen.Programmatically changing the text in a control also triggers this message. |
| %EN_ERRSPACE | Sent when the text box cannot allocate enough memory to meet a specific request. |
| %EN_HSCROLL | Sent when the user clicks a multi-line text box's horizontal scroll bar. The callback is notified before the screen is updated. |
| %EN_KILLFOCUS | Sent when an edit control loses the keyboard focus. |
| %EN_MAXTEXT | Sent when the current text insertion has exceeded the specified number of characters for the text box. The text insertion is truncated. |
| %EN_SETFOCUS | Sent when an edit control receives the keyboard focus. |
| %EN_UPDATE | Sent when a text box is about to display altered text. This notification message is sent after the control has formatted the text, but before it displays the text. Also see %EN_CHANGE |
| %EN_VSCROLL | Sent when the user clicks a text box's vertical scroll bar. The callback is notified before the screen is updated. |
When a Callback Function receives a %WM_COMMAND message, it should explicitly test the value of CBCTL and CBCTLMSG to guarantee it is responding appropriately to the notification message.
Restrictions
See also
Examples