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

Menu on a form 1

Status
Not open for further replies.

Webrookie

Programmer
May 18, 2000
112
US
I created a menu, saved it, and generated it.

On the form I want it to appear on, I added

do menuname.mpr with thisform, .t.

unfortunately, the menu code generated does not have a parameter statement in it, or anything that would link it to a form.

Am I missing something here?
 
In the INIT() event of the form you should add the following code:

LOCAL llRetVal

llRetVal = DODEFAULT()

IF llRetVal
do menuname.mpr with this
ENDIF

RETURN llRetVal

I implemented this quite some times, so I am sure it'll work.

HTH,

Weedz (Wietze Veld)
My private project:And especially for VFP rookies:
 
Sorry weedz, no dice...

here's what VFP generates as menu code
----------------------------------------------------------
SET SYSMENU TO
SET SYSMENU AUTOMATIC

DEFINE PAD _0ga0i61te OF _MSYSMENU PROMPT "Query" COLOR SCHEME 3 ;
NEGOTIATE LEFT, LEFT ;
KEY ALT+Q, ""
DEFINE PAD _0ga0i61th OF _MSYSMENU PROMPT "Reports" COLOR SCHEME 3 ;
NEGOTIATE LEFT, LEFT ;
KEY ALT+R, ""
DEFINE PAD _0ga0i61ti OF _MSYSMENU PROMPT "Batching" COLOR SCHEME 3 ;
NEGOTIATE LEFT, LEFT ;
KEY ALT+B, ""
DEFINE PAD _0ga0i61tj OF _MSYSMENU PROMPT "Exit" COLOR SCHEME 3 ;
NEGOTIATE LEFT, LEFT ;
KEY ALT+E, ""
ON PAD _0ga0i61te OF _MSYSMENU ACTIVATE POPUP query
ON SELECTION PAD _0ga0i61tj OF _MSYSMENU clear events

DEFINE POPUP query MARGIN RELATIVE SHADOW COLOR SCHEME 4
DEFINE BAR 1 OF query PROMPT "Event Date"
DEFINE BAR 2 OF query PROMPT "Event Location"
DEFINE BAR 3 OF query PROMPT "Event Name"
------------------------------------------------------------

so doing the menu with something won't work since there's no parameter statement. So I guess what I'm asking is am I supposed to add the parameter statement everything each time i generate the code? Is that normal?
 
yeah, it gives me "no paramater statement is found"

heh.

I read did a search and read through some other menu errors that were similar to mine...i saw your replies..which were the same.....I can't figure out why yours would work and a select few would not...I copied and pasted your code verbatim..in the init event of my form. My form is "show as top level."

 
With the menu designer open click View | General options

then check the box that says Top Level Form.

Save and generate the menu.

Now it should work just fine.
 
AH HA!
and the lord said he would help webrookie

and the lord revealed himself as rjbalicki

thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top