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

I have a start up form where extens 1

Status
Not open for further replies.

luckydata

Programmer
Sep 15, 2002
10
0
0
AU
I have a start up form where extensive processing is required. I want a message to appear on the form adving the current stage of the processing, eg "Checking Versions", "checking Path info", "updating to new version", "linking to data source". Originally I thought I would need an event that fires after my startup form has openned.
But the messages will not display in a text box after the form has opened, ie the code is moved to an "onclick" event. A slightly jumbled message displays after the code has completed. Can someone advise the event I should use and how to make the messages display please.

David
 
Hi,

You should not put you code in events, but rather let the system update the textbox. To do that you can use .update or doevents (which will allow other event to be processed, e.i. moving the form, switching to other program etc.). You code could look like:

Text1.Text="opening"
doevents 'or text1.update
'do opening here
Text1.Text="Calculating"
doevents 'or text1.update
'do calc here
Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Hi Sunaj,

Thank you for answering. You have completely misunderstood. There is only one proc that has several steps, and in line messages to advise the step in process. That one procedure needs to be executed on an event. If I use form open, the form does not open until the procedure has finnished, which defeats the purpose of the messages, and seems to distort the final message that eventually displays.

I need an event that fires after the form has opened.
David
 
Form_Activate occurs after Form_Load.

Note, however, that it is still likely that you will need to take sunaj's advice concerning deferring to the OS to allow the text boxes to be refreshed when you want them to be (although my preference is generally to use Form.Refresh, rather than text.update or DoEvents - but this is just a preference)
 
Thank you Sunaj and Strongm,
That works great now. I am sorry if my original reply was a little harsh. Sunaj, your advice about delaying the operating system was necessary.
The program I have been working on is "check for the latest version before executing the real application". There are plenty of these around but I have to keep a record of all changes, which now serves as a record of the version numbers. If you ever need something like this just yell

David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top