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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Menu Still Won't Display On My Main Form 1

Status
Not open for further replies.

drosenkranz

Programmer
Sep 13, 2000
360
US
I have a menu (built with the designer) that I want to appear as the menu on the main form of my app. This main form is a top level form. The "top level form" box was checked under the general options dialog while the menu designer was open. The "Set SysMenu Automatic" line was added in the program that loads my defaults and calls the main form. The menu still won't display- What am I missing?
 
How do you start your menu ??

If your menu is called mymenu.mpr there should be a call like:

DO MyMenu.Mpr somewhere in your main startup program, otherwise if you use a form other than the VFP main screen your should add it to the Init() event of the form like following:

LOCAL llRetVal

llRetVal = DODEFAULT()

IF llRetVal
Do MyMenu.mpr WITH THIS
ENDIF

RETURN llRetVal

IF you do it like this the menu will be shown in your form.

BTW did you generate the menu or did you only save it in the menu designer ??

You should generate it first and then an mpr file will be generated (which is actually a prg type file).

Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Weedz,

Thanks for the help. I'm new to VFP- switching over from VB.

What's the difference between "saving" the menu in the designer and "generating" it? I actually had the menu running at one point, made a change, and now it quit appearing again. I've been in and out of VFP twice already before the menu quit? Any light on the subject would be appreciated
 
The difference between saving and generating a menu is:

FoxPro saves almost all its components (classes, forms, reports, menu's) in tables (native DBF type).

When you make a menu with the menu designer, it is saved in an MNX file, which can be openend as a DBF.

When you generate the menu, an MPR (a code file) is generated from the MNX file.

About making changes, check if your MPR file is there, maybe opening it and reviewing the code can shed some light on your problems.

Weedz
veld4663@exact.nl

'It never hurts to help...' - Eek the cat.
 
Weedz...

I put your code in the INIT() of my main form, but when I try to run the programme, I get an error message:

No PARAMETERS statement is found

and the line SET SYSMENU TO is highlighted in the code of my MENU1.MPR

Why is that?

Thanks
 
Thmemuar

Try modfying your menu and in the menu designer, from the menu, go to View-> General options ans select Top-Level form. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first
 
for changes to take effect to the menu, you have to save the menu, then from the menu in fox select generate to creat the new mpr file.

to show yourmenu in the top level form. from the fox menu, with your menu open in design, select view-> general options. select the checkbox 'top level form'.

in the init of the form do:
do mymenu.mpr with this, .t. Attitude is Everything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top