C
Cerebrus
Hi all,
I have an Windows application in which the startup form is called
"MainForm". Now when this form loads, I need to do some intensive tasks
like loading and parsing an XML file, that takes about 10-12 secs.
Initially I was doing it through Multi-threading, by calling the
intensive function (refer to as "LongTask()"), in a separate thread, in
the Load Event of the form. But the pitfall was that the user could
click the MenuItem that requires that function to have completed...
I have since added a "Loading" form with a progressbar as the startup
form, so that MainForm is shown only after all the Loading is done.
Now I am confused about where to add the task intensive function?
Should I transfer all it's code to the "Loading" form ? Or should I
make it a Public function in MainForm and call it from the "Loading"
form ? Or should I use a Shared Sub Main ?
An added complication is that I have to keep track of the progress of
the "LongTask" to show it in a progress bar.
I hope I am able to communicate the problem effectively.
Regards,
Cerebrus.
I have an Windows application in which the startup form is called
"MainForm". Now when this form loads, I need to do some intensive tasks
like loading and parsing an XML file, that takes about 10-12 secs.
Initially I was doing it through Multi-threading, by calling the
intensive function (refer to as "LongTask()"), in a separate thread, in
the Load Event of the form. But the pitfall was that the user could
click the MenuItem that requires that function to have completed...
I have since added a "Loading" form with a progressbar as the startup
form, so that MainForm is shown only after all the Loading is done.
Now I am confused about where to add the task intensive function?
Should I transfer all it's code to the "Loading" form ? Or should I
make it a Public function in MainForm and call it from the "Loading"
form ? Or should I use a Shared Sub Main ?
An added complication is that I have to keep track of the progress of
the "LongTask" to show it in a progress bar.
I hope I am able to communicate the problem effectively.
Regards,
Cerebrus.