The information in this article applies to:
- Microsoft FoxPro for Macintosh, version 2.5b
- Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b
- Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
SUMMARY
By following the procedure below, you can use the FoxPro menu generator to
set a default pad that will be opened the first time a menu is activated.
MORE INFORMATION
The following steps create a menu that will automatically open a pad
named "Reports" when the menu is activated.
- From the File menu, choose New, select Menu, and then choose OK.
- From the Menu menu, choose Quick Menu.
- Add a pad to the menu with the following information:
Prompt - Rep\<orts
Result - Submenu
- Click the Options box, and in the resulting Prompt Options dialog box,
select the Pad Name check box. In the Pad Name box, type "Reports"
(without the quotation marks), and then choose OK.
- Add two bars, A and B, to the Reports pad of the menu.
- From the Menu menu, choose General Options. In the Procedure dialog box,
type the following lines of code:
WAIT WINDOW "You Chose " + PROMPT()
- In the menu's Cleanup code, enter the following line of code:
ACTIVATE MENU _msysmenu PAD reports
- Save the menu with the name TEST, and then generate the menu.
- In the Command window, type the following command:
DO test.mpr
The menu should be activated with the Reports pad open and highlighted.
The above steps will set the default pad only the first time the menu is
activated. If a pad is chosen from the menu, and the ALT key is then
pressed to activate the menu, the first pad on the menu will be
highlighted.
To make the menu appear as if the same default pad is highlighted each time
the menu is chosen, turn off ALT key access to the system menu and create
an ON KEY LABEL command to activate the menu each time menu access is
desired.
To do this:
- Perform steps 1 through 7 above.
- In the menu's Setup code, add the following line:
ON KEY LABEL F10 DO oklf10 IN test.mpr
- Make sure the Cleanup code of the menu reads as follows:
ACTIVATE MENU _msysmenu PAD reports
SET SYSMENU OFF
PROCEDURE oklf10
ACTIVATE MENU _msysmenu PAD reports
- Regenerate the menu.
This menu does not incorporate a foundation READ. If a foundation READ is
not included, and the .MPR file is the main program in an executable file,
the menu will flash on the screen and then exit. Instructions for adding a
foundation READ to a menu are given in article Q87694, here in the
Microsoft Knowledge Base.
|