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

Modeless form behavior

Status
Not open for further replies.

jimstarr

Programmer
Feb 6, 2001
975
US
Kind of a newbie question, but my brain isn't working very well right now. I've got the following code in the Click event of a command button on a toolbar:

Code:
THIS.PARENT.disablethetoolbar
DO FORM clients
THIS.PARENT.enablethetoolbar

This has worked fine up until now when the form "clients" has been modal. But having recently changed the form to modeless, the third line of code gets executed immediately, and the toolbar gets re-enabled. How to prevent this? A READ EVENTS is in effect.

Thanks!!!


Jim
 
Jim,

One option would be to remove the code from the button. Instead, make it the responsibility of the form to enable or disable the toolbar. So, in the form's Init, call the toolbar's Disabletoolbar, and call the EnableToolbar in the form's Destroy.

That said, is that really what you want? If the form is modal, it's right to disable the toolbar, but why would you want to disable it from a modeless form? The whole point of modeless forms is the user can do things outside the form, including interacting with a toolbar.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike,

There's a second form that can be open simultaneously, and I want the user to be able to interact with it. But the functions of the toolbar, like opening other irrelevant forms, and Exiting the application, need to remain out of bounds.

Thanks!


Jim
 
Sounds like you really need to handle the toolbar in the form's Activate and Deactivate methods, so that it's activated when the relevant form is active and deactivate when it's not.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top