How to Easily Give a Screen Its Own User-Defined MenuID: Q123157 2.50x 2.6x | 2.50x 2.6x | 2.5x 2.60a
The information in this article applies to:
SUMMARYThis article shows by example how to create a screen and give it an active menu while also keeping the main system menu active. For example, the Trace window has its own menu and is active while the main FoxPro system menu is active.
MORE INFORMATIONFor information about how to attach a menu to a Visual FoxPro 3.0 form, please see the following article in the Microsoft Knowledge Base:
FoxPro 2.x InstructionsYou could create a menu to be included with a screen by hand coding the menu. But it is easier to use FoxPro's menu generator to generate menu code. Then you can identify and copy the appropriate sections of generated code (.MPR), and paste these sections into the screen code (.SCX).
Step-by-Step Example1. Create a screen file, and give the screen a name in the screen layout. 2. Create a menu to go with the screen by using the menu builder. Then 3. Create a #SECTION2 in the setup code of the screen. On the last line of
4. Copy the "Menu Definitions" section of the generated menu file (the .MPR
5. Copy the menu procedures labeled on the selection bar to the screen
6. In the menu code, replace the first line (SET SYSMENU TO) with "define
7. In the menu code, replace all occurrences of _MSYSMENU with your menu
8. Change the following lines:
9. Add the following line to the ON WINDOW ACTIVATE clause of the screen
10. Generate the screen code, and execute the .SPR file.
NOTE: The menu created in the above example isn't a true system menu, so the menu does not look or behave exactly like a system menu. For example, if you select a menu pad you must execute "DEACTIVATE POPUP padname" to close up the pad. Clicking with the mouse off the menu pad will not deactivate the menu. Additional reference words: FoxWin FoxDos FoxMac 2.50 2.50a 2.50b 2.50c 2.60 2.60a KBCategory: KBSubcategory: FxtoolMBuilder
|
|
Last Reviewed: May 22, 1998 © 1999 Microsoft Corporation. All rights reserved. Terms of Use. |