Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Activating command
Message
From
25/01/2000 12:28:35
 
 
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00322260
Message ID:
00322272
Views:
23
>>>I figured out how to make a menu and generate it, but I can't find anywhere the command to switch to my new menu. What do I put in my main program that will ditch the system menu and use mine instead?
>>>
>>>Thanks,
>>>
>>Michelle,
>>
>>DO YourMenuName.MPR
>
>That's simple enough. I wonder why I couldn't find it in the docs anywhere? I must not have looked in the right spot, I guess.
>

You might try looking in the Programmer's Guide (in the on-line help) under the Topic Creating the Interface/Designing Menus and Toolbars - the following is cut straight out of the docs:


Including Menus in an Application
Once you create a menu system, you can include it in your application.

To include a menu system in your application

Add the .mnx file to your project, then build the application from the project. For more information about building your application, see Chapter 13, Compiling an Application.
Attaching Shortcut Menus to Controls
Once you create and generate a shortcut menu, you can attach it to a control. Shortcut menus typically appear when a user right-clicks on a control. You can attach a shortcut menu to a particular control by entering a small amount of code in the right-click event of the control.

Select the control to which you want to attach the shortcut menu.


In the Properties window, choose the Methods tab and select Right Click Event.


In the code window, type DO menu.MPR, where menu is the name of the shortcut menu.
Note Be sure to use the .mpr extension when referencing shortcut menus.

Attaching SDI Menus to Forms
Once you create an SDI menu, you can attach it to an SDI form. In addition, you must:

Set the form’s ShowWindow property.
Add a DO statement to the form’s Init event.
To attach an SDI menu to a form

In the Form Designer, set the form’s ShowWindow property to 2 – As Top Level Form.


In the Init event of the form, call the menu.
For example, if your menu is called SDIMENU.MPR, add this code:

DO SDIMENU.MPR WITH THIS,.T.


I added the color. IOW, RTFM. Having Jim around is no excuse not to read the docs in the first place!
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform