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

Modal Form

Status
Not open for further replies.

sdocker

IS-IT--Management
Aug 12, 2010
218
GB
I have a form that has the following properties;
Closable = .F.
Desktop = .T.
ShowWindow = 2 - As Top level Form
WindowType = 1 - Modal

When the form is called it is not Modal. I coded THISFORM.SHOW(1) in the Init procedure, but the WindowType return 0 - Modeless.


What happens is, if I click on the underlying form, the underlying form closes and the problem form remains active. When I close the app the problem form is there, but it disappears after a few seconds.


For what it's worth, I did not have this problem until I started a user defined toolbar.

Sam
 
IIRC, top level forms are never modal no matter what you do.

Also, for whatever it's worth, DO NOT call form.Show from form.Init. Instead, DO FORM ... NOSHOW, and then call Show from the calling code. Otherwise, you're messing with the normal event model, and that generally doesn't end well.

Set ShowWindow to *in* top level form (and display it in another form) to get modal.
 


Thank you Dan,

All working fine and suggestions noted.

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top