DlgText (statement)

Syntax

DlgText {ControlName$ | ControlIndex}, NewText$

Description

Changes the text content of the specified control.

Comments

The effect of this statement depends on the type of the specified control:

 

Control Type

Effect of Dlg Text

 

Picture

Runtime error.

 

Option group

Runtime error.

 

Drop list box

Sets the current selection to the item matching NewText$. If an exact match cannot be found, the DlgText statement searches from the first item looking for an item that starts with NewText$. If no match is found, then the selection is removed.

 

OK button

Sets the label of the control to NewText$.

 

Cancel button

Sets the label of the control to NewText$.

 

Push button

Sets the label of the control to NewText$.

 

List box

Sets the current selection to the item matching NewText$. If an exact match cannot be found, the DlgText statement searches from the first item looking for an item that starts with NewText$. If no match is found, then the selection is removed.

 

Combo box

Sets the content of the edit field of the combo box to NewText$.

 

Text

Sets the label of the control to NewText$.

 

Text box

Sets the content of the text box to NewText$.

 

Group box

Sets the label of the control to NewText$.

 

Option button

Sets the label of the control to NewText$.

 

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

Sub Main()

  DlgText "GroupBox1","Save Options"     'Change text of group box 1.

  If DlgText$(9) = "Save Options" Then
    DlgText 9,"Editing Options"      'Change text to "Editing Options".
  End If
End Sub

See Also

DlgEnable (function); DlgEnable (statement); DlgFocus (function); DlgFocus (statement); DlgListBoxArray (function); DlgListBoxArray (statement); DlgSetPicture (statement); DlgText (statement); DlgValue (statement); DlgValue (function); DlgVisible (statement); DlgVisible (function).

More information

D