DialogResult Property
Applies To
Form
Description
Gets or sets the dialog result for a form.
Usage
GGet Form.DialogResult, var
GSet Form.DialogResult, value
- Form
- Name of a form or string variable containing a form name.
- var
- Integer variable that will contain the value of the property.
- value
- Integer expression for the new value of the property.
Values
0 - None
1 - OK
2 - Cancel
Default: Cancel
Remarks
DialogResult is used to indicated if the user accepted a form or canceled it.
Typically, a dialog has an OK button and a Cancel button. When the user clicks the OK button, the DialogResult property is set to 1 - OK in the button click event. If the Cancel button is clicked, the DialogResult property is set to 2 - Cancel.
See Also
Form
Example
Function frmSetSpeed_btnOK_Click(Sender$ As String)
GSet frmSetSpeed.DialogResult, DIALOGRESULT_OK
GClose frmSetSpeed
Fend
Function frmMain_btnSetSpeed_Click(Sender$ As String)
Integer result
String speed$
result = GShowDialog(frmSetSpeed)
If result = DIALOGRESULT_OK Then
GGet frmSetSpeed.txtSpeed.Text, speed$
g_RobotSpeed = Val(speed$)
Fend