Syntax |
DlgText$(ControlName$ | ControlIndex) |
|
Description |
Returns the text content of the specified control. |
|
Comments |
The text returned depends on the type of the specified control: |
|
|
Control Type |
Value Returned by DlgText$ |
|
Picture |
No value is returned. A runtime error occurs. |
|
Option group |
No value is returned. A runtime error occurs. |
|
Drop list box |
Returns the currently selected item. A zero-length string is returned if no item is currently selected. |
|
OK button |
Returns the label of the control. |
|
Cancel button |
Returns the label of the control. |
|
Push button |
Returns the label of the control. |
|
List box |
Returns the currently selected item. A zero-length string is returned if no item is currently selected. |
|
Combo box |
Returns the content of the edit field portion of the combo box. |
|
Text |
Returns the label of the control. |
|
Text box |
Returns the content of the control. |
|
Group box |
Returns the label of the control. |
|
Option button |
Returns the label of the control. |
|
The ControlName$ parameter contains the name of the .Identifier parameter associated with a control in the dialog box template. A case-insensitive comparison is used to locate the specific control within the template. Alternatively, by specifying the ControlIndex parameter, a control can be referred to using its index in the dialog box template (0 is the first control in the template, 1 is the second, and so on). |
|
Example |
This code fragment makes sure the user enters a correct value. If not, the control returns focus back to the TextBox for correction. Function DlgProc(ControlName$,Action%,SuppValue%) As Integer If Action% = 2 and ControlName$ ="OK" Then Sub Main() Dim ListBox1$() |
|
See Also |
DlgControlId (function); DlgEnable (function); DlgEnable (statement); DlgFocus (function); DlgFocus (statement); DlgListBoxArray (function); DlgListBoxArray (statement); DlgSetPicture (statement); DlgText (statement); DlgValue (function); DlgValue (statement); DlgVisible (statement); DlgVisible (function). |
D |