CONTROL ADD TEXTBOX

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > UI (User Interface) > CONTROLS > Control Types > Textbox Control > Textbox Control Creation >

CONTROL ADD TEXTBOX

 

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_CHANGESent 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_ERRSPACESent when the text box cannot allocate enough memory to meet a specific request.
%EN_HSCROLLSent when the user clicks a multi-line text box's horizontal scroll bar. The callback is notified before the screen is updated.
%EN_KILLFOCUSSent when an edit control loses the keyboard focus.
%EN_MAXTEXTSent when the current text insertion has exceeded the specified number of characters for the text box. The text insertion is truncated.
%EN_SETFOCUSSent when an edit control receives the keyboard focus.
%EN_UPDATESent 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_VSCROLLSent 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