Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using menu from modal form
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00458308
Message ID:
00673645
Views:
101
Wow, talk about a blast from the past! (18 months since that post)

I've since found a better place for the menu.

In your Form.Init:
PUSH MENU _MSYSMENU

In your Form.GotFocus:
DO yourmenu.mpr

In your Form.Destroy:
POP MENU _MSYSMENU

This should work, and doesn't require a flag for the menu activation. The
Paint method should work, but Paint get's fired off for many reasons (one of
which is if you're current field has a blinking cursor!).


>Hi Fred,
>
>I tried to do what you suggested and it did not work for me.
>I have one main model form and entered the 2 lines in the GotFocus method and the menu options still were not available. I tried that either in VFP 6 or VFP 7. This main form is called from the main prg.
>
>PUSH MENU _msysmenu
>DO modal.mpr
>
>Also the other suggestion worked if I let the Paint method to be fired all the time without the IF NOT this.lMenuDone.
>
>Any ideas?
>
>Regards,
>
>Doron
>
>
>
>>>>
>>>>Add a property called lMenuDone to your modal form. This code in the form's Paint method:
>>>>
>>>>
>>>>IF NOT This.lMenuDone
>>>>   PUSH MENU _MSYSMENU
>>>>   This.lMenuDone = .T.
>>>>   DO MyMenu.prg
>>>>   DO MyMenu.prg
>>>>ENDIF
>>>>
>>>>
>>>>Then you can issue a POP MENU in the form's Unload.
>>>
>>>Marcia,
>>>
>>>why i must run
>>>
>>>DO MyMenu.prg
>>>
>>>twice?
>>>
>>>One line seems to be sufficient.
>>>Is it possible to use vfp standard _msysmenu (e.q.standard copy, edit,paste pads) ? I do'nt want to define new menu of each modal form.
>>>
>>>It it possible to run this code in some other event than paint (Load event)?
>>>I haven't never used paint.
>>
>>You can put in your Form's GotFocus:
>>
>>PUSH MENU _msysmenu
>>DO modal.mpr
>>
>>and in your Form's Unload:
>>
>>POP MENU _msysmenu
>>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform