Dialog Instruction/Function
Syntax
Dialog dialogvar[, default] -or- Dialog(dialogvar[, default])
Group
Description
Displays the dialog associated with dialogvar. The initial values of the dialog fields are provided by dialogvar. If you click OK or any button, the fields in dialog are copied to the dialogvar. The Dialog( ) function returns a value indicating which button is clicked. See the following table.
Parameters
| Parameters | Description |
|---|---|
| dlgvar | The variable that holds the values of the fields in a dialog. Use .field to access individual fields in a dialog variable. |
| default | The default button. (Pressing Enter on your keyboard on a non-button pushes the default button.) Use -2 to indicate that there is no default button. Other possible values are shown in the table below. If this value is omitted, the first PushButton, OKButton, or CancelButton is the default button. |
| Result | Description |
|---|---|
| -1 | OK button is pressed. |
| 0 | Cancel button is pressed. |
| >0 | Nth push button is pressed. |
Example
Sub Main Begin Dialog UserDialog 200,120 Text 10,10,180,15,"Please push the OK button" OKButton 80,90,40,20 End Dialog Dim dlg As UserDialog Dialog dlg ' show dialog (wait for ok) End Sub
See also