Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple method to show a menu
Message
From
23/10/2002 12:18:51
 
 
To
23/10/2002 06:08:12
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00714256
Message ID:
00714432
Views:
17
Mircea-

>Witch is the simplest method an configure all SET parameters to start a program in VFP 6 or 7 for showing a menu ? I started with an empty form, form is displayed, but just after the form is closed all menu appear. Thanks for help to all of you.

I hope I understand what you need. Here is an example of putting a menu in a top-level form.
*!* MyMenuTest.PRG
LOCAL loForm AS FORM
loForm = NEWOBJECT('MyMenuForm')
loForm.SHOW()
READ EVENTS

DEFINE CLASS MyMenuForm AS FORM
	CAPTION = "My Menu Form"
	SHOWWINDOW = 2
	WINDOWTYPE = 1
	PROCEDURE INIT
		DO MyMenu.mpr WITH THIS,.T.,.T.
	ENDPROC
	PROCEDURE QUERYUNLOAD
		CLEAR EVENTS
	ENDPROC

ENDDEFINE

*!* How-to
*!* 1. CREATE MENU MyMenu
*!* 2. Select Edit | View... | General Options, and check Top-Level Form
*!* 3. Select Menu | Generate...
*!* 4. MODI COMM MyMenu.MPR
*!* 5. Read the header comments for instructions on doing a menu in a Top-Level Form
PROCEDURE ShowMenu
	LPARAMETERS oFormRef, getMenuName, lUniquePopups, parm4, parm5, parm6, parm7, parm8, parm9
	DEFINE MENU (m.cMenuName) IN (m.oFormRef.NAME) BAR
	DEFINE PAD _0sm0jjcel OF (m.cMenuName) PROMPT "MyMenuPad" COLOR SCHEME 3 ;
		KEY ALT+M, ""
	ACTIVATE MENU (m.cMenuName) NOWAIT
	IF m.cTypeParm2 = "C"
		m.getMenuName = m.cMenuName
		m.oFormRef.NAME = m.cSaveFormName
	ENDIF
ENDPROC
Previous
Reply
Map
View

Click here to load this message in the networking platform