Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to set Menu item by code / table?

Status
Not open for further replies.

paispatin

Technical User
Oct 21, 2003
62
A1
Dear all,

I would like to make a menu for VFP 8, usualy I create it form project menager, and create a menu from Menu Designer.

Can I create a menu from prg file and also create a menu from a table to set the item at that menu?

Thank you in advance.
 
paispatin,

The menu designer is really just a code generator. There is nothing to stop you writing the code by hand, directly in a PRG. But I think you'll find it easier to use the designer.

To get a flavour of menu code, generate a menu in the normal way. Call it, say TEST. Then look for a file with the same name and an extension MPR (so, TEST.MPR in this case). Open it in an editing window. That's the sort of code you would write if you did it by hand.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Thank you very much for the answer. Actualy I would like to make a menu which have dynamic form. The count of form is define at setup menu.

So if I setup for 5 form, than the pop-up menu will be show from Form 1 to Form 5. If I setup for 3 form, than the pop-up menu will be show from Form 1 to Form 3.

That's why I would like to know, maybe there is something to make/generate menu from PRG or a table (which the value is form count from setup before)

Thank you very much.
 
That's why I would like to know, maybe there is something to make/generate menu from PRG or a table (which the value is form count from setup before)

As Mike suggested, create a menu with the menu designer, save it and take a look at the file with an .mpr extension and there is you menu in a prg format, you can modify all you want and run it form the prg.


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
You can put "DO MyMenu.MPR" in a .prg file, or copy and paste the sample menu code generated into a Function/Procedure in a .prg (Procedure file).

Then you can call the Function/Procedure with Parameters you create and set as needed. The parameters can control what you want the menu to display.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top