Dialog Object
From SecureCRT
Description
The Dialog object provides access to simple user-interface features provided by SecureCRT.
Syntax
crt.Dialog.Method([arglist])
Remarks
SecureCRT's
Dialog object is accessed through the top-level object’s Dialog
property.
Dialog Object Methods
Description
Prompt a user to enter a string.
Syntax
crt.Dialog.Prompt(message [, title [, default [, isPassword ]]])
Remarks
The Prompt function displays a simple dialog that has message and an edit field for the user to enter a string. The message parameter is an informational string displayed in the prompt dialog. Optionally the title of the prompt dialog may be set by passing a title string. By default the edit field is empty, but the initial contents of the edit field may be set with the optional default string. Finally, if the text entered in the edit field is to be obscured as it is entered (such as when entering a password) then the Boolean isPassword field should be set to True.
If the user clicks OK, Prompt returns the entered string.
Example:
Description
Display a message
Syntax
crt.Dialog.MessageBox(message [, title [, buttons]])
Remarks
The MessageBox function displays a message string to the user. The optional title string sets the title or caption of the MessageBox. The buttons that appear on the MessageBox can be configured by passing a combination of numeric values in the optional ‘buttons’ parameter. By default MessageBox will display the message string with an OK button. However, many possibilities exist for displaying message boxes with different icons, and buttons.
The MessageBox function returns a numeric value that can be used to identify which button was clicked.
The following code sample defines the constants that can be combined to form the ‘button’ parameter as well as the possible numeric return values: