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

Startup form doesn't display long enough for user input

Status
Not open for further replies.

markathon

Programmer
Jul 11, 2002
7
US
I have a form that must display a lengthy Security Message prior to the user logging into the application. The form has an editbox, set to transparent, where the text message is displayed; an OK button to use to exit the form, and a Warning icon. The form's Show Window property is set as "Top-level form", the Window Type property is set to "Modeless", and the Border Style is "Fixed Single". This form is basically just mimicking a very large messagebox. I couldn't use a Messagebox() because the string length limitation chopped off the last two sentences.

This form is displayed during the beginning stage of the main startup program. It instantiates, but then closes immediately, way too fast before the user has a chance to select the OK button to close the form. I can't wait until the READ EVENTS occurs because by then the whole application has been instantiated, with user logged in and everything. I have tried using a timer class but that put the mouse cursor into an "hour glass" wait state and the Ok button never became active. I may be doing something way wrong here but I am not figuring it out. Any ideas?

Thanks
 
HI You can think of a mesage box in the following way.

myMessage = "This my Sentence one."+CHR(13)
myMessage=myMessage+"This my Sentence two."+CHR(13)
myMessage=myMessage+"This my Sentence three."+CHR(13)
myMessage=myMessage+"This my Sentence four."+CHR(13)
=MESSAGEBOX(myMessage)

This way the message box content can be increased.
:)

ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com

 
Thank you for the suggestion. I had already tried that, it doesn't solve the maximum string length problem in the Messagbox function. I can make a 86 char line and it will display 12 rows of them, Messagebox won't display more than 1032 chars.

But that is not the problem I was asking for help about here. I still would like some ideas on the form problem, to get it to stay on screen in a wait state so that the user can read the message, and then click Ok to proceed into the application. Thanks.

markathon
 
Markathon,

Put another READ EVENTS immediately after the DO FORM for the top-level form. And put a CLEAR EVENTS in the Destroy of that form.

There is nothing wrong with having two separate READ EVENTS in your main program. In fact, I believe that is the only way to handle this situation, as a top-level form cannot be modal.

Mike


Mike Lewis
Edinburgh, Scotland
 
Mike,

Thanks for your post, I figured out the same thing a bit earlier today while reading about READ EVENTS in the Help file. I put a READ EVENTS just after the "do Form myForm" line. Then, in the form itself, I put a CLEAR EVENTS in the Click event of the OK command button on the form. So now the form remains visible until user clicks Ok, then the program will continue on until the event loop processing establishes READ EVENTS later on in Main.prg.

markathon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top