共用方式為


Messagebox Handler Foundation Class

Category Misc Forms
Default Catalog Visual FoxPro Catalog\Foundation Classes\Utilities
Class _msgbox
Base Class Custom
Class Library _dialogs.vcx
Parent Class _custom

Remarks

This class provides a simple wrapper around the MessageBox function so you can easily display a message box of a specified type with alternate contents.

To use, drop the class on a project or form or, from the Component Gallery Item Shortcut Menu, select Add to Project or Add to Form. When you add the class to a form, specify the appropriate values for the message (cMessage), the type of message box (nType), and other appropriate properties. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods Description
cMessage property Specifies the message box message text.
Default: ""
nType property Specifies the message box type. For options, see MessageBox( ).
Default: 48
cTitle property Specifies the message box title text.
Default: _screen.caption
lBeep property Specifies whether a beep occurs when message box is activated.
Default: .F.
Show method Displays a message box and returns the dialog box result.
Syntax: Show(tcMessage, tnType, tcTitle, tlBeep)
Return: this.Display( )
Arguments:
tcMessage specifies the text that appears in the dialog box.
tnType specifies the buttons and icons options, the default button, and the behavior of the dialog box.
tcTitle specifies the text that appears in the title bar of the dialog box.
tlBeep specifies whether an alert sound accompanies the display of the dialog box.
Set method Sets the properties for the dialog box message, type, title, and alert sound. Internal to the class.
Syntax: Set(tcMessage, tnType, tcTitle, tlBeep, tnParameters)
Return: none
Arguments:
tcMessage specifies the text that appears in the dialog box.
tnType specifies the buttons and icons options, the default button, and the behavior of the dialog box.
tcTitle specifies the text that appears in the title bar of the dialog box.
tlBeep specifies whether an alert sound accompanies display of the dialog box.

See Also

Guidelines for Using Visual FoxPro Foundation Classes | Visual FoxPro Foundation Classes A-Z | Visual FoxPro Foundation Classes