"wait..." message box

alanchinese

Regular
Joined
Jan 12, 2005
Messages
62
my forms takes a while to load because it needs to select a huge table.

thereform, i want my forms to display a "wait..." messagebox: inside the load function, a messagebox is display in the beginning, and automatically close by itself right before the load function ends.
the "wait..." message box also includes a button called "cancel", that when the user is out of patience they can click it and terminate the form.
i made this working by using a new thread and calling delegate functions in the main thread. i just wonder how others are handling this issue.

furthermore, i wish i can have a thread that loads each section of data into different tabpages. that will greatly inprove the user interfaces, since most of the users are impatience and try to close the form before it finishes loading.
 
You did it right...

Now... if the users want to close the form before it's loading process is donne... why load it in the first place?? Can't you make a previous & lighter (less time to load), from where the users can choose where and how to go from there?

Alex :p
 
How about instead of a message box you have a me.show right at the beginning of the load sub and right after have it draw Wait.. straight to the form. Then when the rest of the stuff loads, have it draw right over that Wait..
 
alanchinese said:
i made this working by using a new thread and calling delegate functions in the main thread.

Could someone please elaborate (including code snipets in VB.NET if possible) on how this "Wait Message" with threading is accomplished.
 
Is this form loading when you first start the application, or is this a form the user must navigate to through some sort of menu? In the case of the former, you could create a Splash Screen, Right click your solution in the Solution Explorer and select 'New Item' and then choose 'Splash Screen' then before you call the db load table function do a

Visual Basic:
'Visual Basic.NET 2005
MySplashScreen.Show()

'Visual Basic.NET 2003
Dim frmSPSC as New MySplashScreen()
frmSPSC.Show()

If this is a screen that the user navigates to, you could still use the generic MS Splash Screen and modify the labels on it to better suit your needs.

HTH
-Nate
 
Back
Top