Purpose
Removes a custom dialog from the screen.
Syntax
Dialog Remove
Restrictions
This statement may only be issued from within a sub procedure that acts as a handler for a dialog box control. You cannot issue this statement from the MapBasic window.
Description
The Dialog Remove statement removes the dialog box created by the most recent Dialog statement. A dialog box disappears automatically after the user clicks on an OKButton control or a CancelButton control. Use the Dialog Remove statement (within a dialog box control's handler routine) to remove the dialog box before the user clicks OK or Cancel. This is useful, for example, if you have a dialog box with a ListBox control, and you want the dialog box to come down if the user double-clicks an item in the list
Example
The following procedure is part of the sample program NVIEWS.MB. It handles the ListBox control in the Named Views dialog box. When the user single-clicks a list item, this handler procedure enables various buttons on the dialog box. When the user double-clicks a list item, this handler uses a Dialog Remove statement to dismiss the dialog box.
Sub listbox_handler
Dim i As SmallInt
Alter Control 2 Enable
Alter Control 3 Enable
If CommandInfo(CMD_INFO_DLG_DBL) = TRUE Then
'
' ... then the user double-clicked.
'
i = ReadControlValue(1)
Dialog Remove
Call go_to_view(i)
End If
End Sub
See Also:
Alter Control statement, Dialog statement, Dialog Preserve statement, ReadControlValue() function