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

Menu is allways enabled

Status
Not open for further replies.

mkendi

Programmer
Oct 21, 2000
82
TR
Although I call a modal form with DO FORM xxx from a menu, the main-menu does not change to his dimmed form, so the user can select the form more than once.
In all my other vfp programs the behaviour of the main-menu is as expected: dimmed, after the user has selected a modal form.
The only special thing in this form is a simple timer.
Thanks for your help in advance
 
mkendi

You can enable/disable menu options through the Skip For option available in the dialog when you click on the Options button in the Menu designer

If you launch your form through a procedure on the menu, you could put :-

PUBLIC oForm1
DO FORM form1 NAME oForm1

to be the procedure.

In the Skip For option put

VARTYPE(oForm1) = [O]

Thus if the form exists, the menu option will be disabled.

In the .Unload() event of form1, put :-

RELEASE oForm1


to release the object reference.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Thanks for the fast reply.
I will test it in the next minutes.
But can you explain me, why the menu does not disable, when the modal form appears?
 
I have tested your tip. Unfortunately it does not work. But it was a good idea.
So I made a SubMenu, and now the menu is disabled, as soon as the form appears.
Thanks anyway.
 
mkendi

I had assumed, (usually a mistake), that you were calling your form from a submenu, in which case the code works.

If not, as it appears, then without running the menu again to 'refresh' it, the menu option will not be disabled.

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top