The information in this article applies to:
- Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
- Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b
- Microsoft FoxPro for Macintosh, version 2.5b
SUMMARY
Many applications use confirmation screens that present the user with
push buttons to answer a question.
The steps below describe how to use the Screen Builder to create a
confirmation screen containing Yes and No push buttons.
MORE INFORMATION
Sample Confirmation Screen with Yes and No Push Buttons
- Type the following in the Command window to start the Screen
Builder:
CREATE SCREEN
- Place a text field on the screen. (In FoxPro for Windows or FoxPro
for Macintosh, select the Text tool from the toolbox. In FoxPro for
MS-DOS, choose Text from the Screen menu.)
- In the text field, type the question asked of the user. For this
example, type the following:
Save changes?
- Place a push button on the screen. (In FoxPro for Windows or FoxPro
for Macintosh, select the Push Button tool from the toolbox. In
FoxPro for MS-DOS, choose Push Button from the Screen menu.)
- Under Push Button Prompts, type "\!\<Yes" (without the quotation
marks)in the first column.
NOTE: The backslash and exclamation mark characters (\!) at the
beginning of the push button prompt designate this push button as
the default. The backslash and less-than characters (\<|) in front
of the letter Y designate Y as the access key (also known as a hot
key.)
- Move down to the second row under Push Button Prompts. Type
"\?\<No" (without the quotation marks) in the second prompt area.
NOTE: the backslash and question mark characters (\?) at the
beginning of the push button prompt designate it as the escape or
cancel push button. The backslash and less-than characters (\<|)
in front of the letter N designate N as the access key.
- In the Variable text box, type "m.confbtn" (without the quotation
marks).
- Under Clauses, choose Valid.
- Verify that the Procedure radio button is selected, then type the
following in the text editing region:
IF m.confbtn = 1
* Place the code performed when "Yes" is chosen here.
ELSE
* Place the code performed when "No" is chosen here.
ENDIF
CLEAR READ
- Choose OK twice to return to the Screen Design window.
- From the Program menu, choose Generate.
- When prompted to save changes to the screen, choose Yes, then save
the screen with the name TEST.
- When prompted to save environment information, choose No.
- In FoxPro for Windows and FoxPro for Macintosh, choose the More
button in the Generate Screen dialog box to view all Generate options.
(FoxPro for MS-DOS automatically displays all Generate options.)
- Clear the Open Files and Close Files check boxes.
- Choose the Generate button.
- Run TEST.SPR to test the screen.
NOTE: If the screen appears briefly, then clears before a push button
has been selected, add the following code to the screen's Setup
snippet in order to initialize the push button variable:
m.confbtn = 1
|