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

How to disable Form?

Status
Not open for further replies.

august

MIS
Aug 24, 2000
150
PH
How can i enable form if there is an active window open?
If: I have a main menu then i open(click) command button
that open another window, my problem is how can i disable the main menu while there is an open window or there is an open form? i mean cannot click on any buttons of the main menu while there is an active one?

Any ideas on how i can do it?

August [sig][/sig]
 
Look to Help for command 'SET SKIP OF' (not 'SET SKIP' - this is different command!)
The ways to do this - its depended on the structure of your application. Following is example how we made this in our application. I guess this is the most universal way.
We have special global object, named 'oMenu', that controls all menu items. Menu is data-driven, that means that it is built using database data (for each user - different menu items and layout, edited by special forms). In the oMenu object we have methods like 'ModalFormOpen' and 'ModalFormClose', as well as 'DisableFormSpecificItems' and 'EnableFormSpecificItems'. These pairs of methods called from our base form class methods Load/Show and Destroy. First pair in case when form is modal (entire menu should be disabled for all modeal forms, maybe with some exceptions like for Exit menu item). Second pair is for modeless forms. For modeless form, oMenu object search database for form-specific information to disable special menu items. (For example, you run form that cannot coexist with some other modeless forms that could be ran from menu.)


[sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
i'ved try some &quot;funky moves&quot; on my prog.

in the main menu that call another windows

thisfom.cmdOPEN1.enabled = .f.
do form OPENWINDOW1

it does there is no buttons u can click on the main menu
then my problem is : if i'm in the current window(OPENWINDOW1) how can i call enabled property of the main menu to run on the current window b-4 returning to main menu.

is my program okay? is this a good idea? i mean my sample prog.

august [sig][/sig]
 
Check SET SKIP OF command in the help. It is special to disable menu items.
thisform for main menu? menu is not a form... [sig]<p>Vlad Grynchyshyn<br><a href=mailto:vgryn@softserve.lviv.ua>vgryn@softserve.lviv.ua</a><br>[/sig]
 
Another way to disable your main menu form is to set the window state to MODAL in the PEM so that when another form is active it will be automatically disabled or you can set your succedding form IN TOP LEVEL FORM.

Wendz
edbb@lycos.com [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top