How to Use the MsgBox() Function in FOXTOOLS.FLLID: Q105006 2.5x 2.6x 3.00 WINDOWS The information in this article applies to:
SUMMARYThe MsgBox() function in FOXTOOLS.FLL displays a message in a dialog box, waits for the user to choose a button, and returns a value indicating which button was chosen. By using the MsgBox() function, you can take advantage of the Windows default message dialog boxes. Another benefit of using the MsgBox() function is that it does not create a new READ level. Below is syntax information about MsgBox() and a code example. NOTE: In FoxPro 2.x, when you are using the MsgBox() function in a project, the FOXTOOLS.FLL file must be listed, or you will receive an "Undefined reference" error message. In Visual Foxpro, however, FOXTOOLS.FLL isn't required in order to use the MESSAGEBOX() Function. For more information, see the MESSAGEBOX() topic in online Help.
MORE INFORMATION
Function Syntax
The MsgBox() function takes these arguments:
1. <msg> - Character expression displayed as the message in the dialog box. 2. <title> - Character expression displayed in the title bar of the dialog 3. <type> - Numeric expression that controls the buttons and icons to
MsgBox displays a maximum of 1024 characters. Longer messages are truncated
after the 1024th character. Message strings longer than 255 characters with
no intervening spaces are truncated after the 255th character.
MsgBox breaks lines automatically at the right edge of the dialog box. To set line breaks manually, place a carriage return (ANSI character 13) and a linefeed (ANSI character 10) before the first character of the text that is to begin each new line. The argument type is the sum of values that specify the number and type of buttons to display, the icon style to use, and the identity of the default button. The following table illustrates the values used and the meaning of each group of values:
The first group of values (1-5) describes the number and type of buttons
displayed in the dialog box; the second group (0, 16, 32, 48, 64) describes
the icon style; and the third group (0, 256, 512) determines which button
is the default. When adding numbers to create a final value for the
argument type, use only one number from each group. The value returned by
the MsgBox() function indicates which button has been chosen, as shown in
the following table:
If the dialog box displays a Cancel button, pressing the ESC key has the
same effect as choosing Cancel.
Sample Code
Additional reference words: FoxWin VFoxWin 2.50 2.50a 2.50b 2.60 2.60a 3.00
alert
KBCategory:
KBSubcategory: FxprgFoxtools
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |