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

Menu

Status
Not open for further replies.

lastimosa

Instructor
Aug 13, 2002
15
PH
I tried many ways to activate a menu I created on a form. But none of them works. How to do this.
 
lastimosa

Menus conventionally run in _SCREEN, not specifically in a form, although that's also possible.

Assuming you have a main.prg, you normally run the menu before calling your main form.

DO mainmenu.mpr
DO FORM mainform NAME oMainForm LINKED
READ EVENTS

HTH

Chris [pc2]
 
Chris

I just tried the code that you gave me, but its still wont work. The prompt are displayed but it is not on the form I created.

 
lastimosa

'Menus conventionally run in _SCREEN, not specifically in a form'

The menu will not show within a individual form, unless it's a top-level form and you have specifically set it up that way.

In another thread you commented that you were unable to generate a menu - I assume you have resolved this and now have a menu with the extention .mpr.

If your menu is now the main menu, that is the correct behaviour.

If you want your menu to contained within a form, then you need to make the form a top-level form and attach the menu to the form.

There's no point in persuing that until you have a menu showing in _SCREEN.

If you browse through the FAQs, I believe there is a FAQ that covers menus in top-level forms. HTH

Chris [pc2]
 
as mention above, make the form top level

then in the init of the form

do mymenu.mpr with this, .t. Attitude is Everything
 
To complete danceman's suggestion, the menu itself has to be a top-level menu.
 
lastimosa

If you really want to go the distance with top-level forms you can also get a toolbar to run underneath the top-level form's menu.

The content of the menu/toolbar should be specific to the top-level form and will give the top-level form the look and feel of a mini-application attached to your main application.

What I would suggest is that you consider the top-level form as secondary to your other forms and make sure you have a menu and toolbar running in _SCREEN.

You can also consider _SCREEN to be a top-level form which contains child forms.

If you add a .Resize() and a .Moved() method to _SCREEN, then you can resize _SCREEN by resizing a child form of _SCREEN.

Alternatively, you can resize a child form(s) of _SCREEN by resizing _SCREEN.

The .Moved() method can save _SCREEN's coordinates for next time the application is run.

HTH

Chris [pc2]
 
Thank you very much for your reply. I tried it already yesterday and it works. Before I posted a question I'd browsed already the FAQ's but I never found an answer.

Once again thank you for your unselfish work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top