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

What am I doing wrong? Program halts before loading form

Status
Not open for further replies.

FBM357

MIS
Jun 2, 2003
77
US
Hello All,

I've a problem which probably requires a very simple solution. I've a form with the following code attached to an exit button:

LOCAL nResponse

nResponse=MESSAGEBOX('Do you want to quit this application?',4+32,'Confirm action')
IF nResponse=6
CLEAR EVENTS
ENDIF
THISFORM.Release
RETURN

In my MAIN.prg I have;

if blah()
DO myform
READ EVENTS
ELSE
* display error message
ENDIF


Why doesn't this properly work? Executable doesn't work either. Execution of 'blah()' works fine, however the form doesn't load.

TIA,

Vernon

Don't question where I'm going when you don't know where I've been, know what I mean?
 
I think, form is WindowType=modeless. Yes?

If it is form with ShowWindow=0 or 1 (in Screen, in Top level window), check if parent is visible - f.e. _screen.Visible=.T.

Add MESSAGEBOX into forms Init method, just before its end.

If it dispays properly, then you know, that the form (as object) is properly created. In such case problem is with its visibility.
 
Hi Vernon,

Put CLEAR EVENTS in the Destroy event of your main form. The code you posted will either close the form without CLEAR EVENTS which will hang VFP or exit.

Also it's not DO Myform, it's DO FORM MyForm.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top