473,504 Members | 13,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Load -> show form... then do stuff

Right now I have a vb.net windows form project that does a whole bunch of
things on the form.load event. The problem with this is that the user does
not see the form until all the those things are done.

Is there a way for a form to be shown first AND THEN have it automatically
start to run through my code? (perhaps a different event??? form.paint,
form.activate)

Right now... the form is running but the user can't see it, and so they end
up clicking on the application to run again and the user thinks the program
is slow... AND WE CAN'T HAVE THAT!!!! :)

I would like:
Basically the form would load
i would have a status bar that says "loading data"... and then the form
would then show the data once it's loaded

Any help would be greatly appreciated!
Chris Thunell
ct******@pierceassociates.com
Nov 22 '05 #1
6 3504
On 31/08/2005 Chris Thunell wrote:
I would like:
Basically the form would load
i would have a status bar that says "loading data"... and then the
form would then show the data once it's loaded

Use a global boolean variable called something like m_blnActivated, set
it to false, then put all your stuff in the Form Activate event but
only run it if m_blnActivated is false. After the first run set
m_blnActivated to true so it doesn't run again.

I have just used this technique in an app where I had the same issue as
you.

--
Jeff Gaines
Nov 22 '05 #2
Chris,

You can replace all your not real formloading code to the form_activated
event and than set in it

\\\
static done as boolean
if not done then
....
....
done = true
end if
///

I hope this helps,

Cor
Nov 22 '05 #3
Hi Chris,
How are you doing?

I would suggest you to start your project with a form with a progress or
some message informing the users that the application is loading
and in this form put up the code for loading your real form. When the real
form has completed loading you may place the first startup form
to hide/unload in the real form's activate event.

I hope this is helpful.
Thanks
Mona
[Grapecity]

"Chris Thunell" <ct******@pierceassociates.com> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
Right now I have a vb.net windows form project that does a whole bunch of
things on the form.load event. The problem with this is that the user does not see the form until all the those things are done.

Is there a way for a form to be shown first AND THEN have it automatically
start to run through my code? (perhaps a different event??? form.paint,
form.activate)

Right now... the form is running but the user can't see it, and so they end up clicking on the application to run again and the user thinks the program is slow... AND WE CAN'T HAVE THAT!!!! :)

I would like:
Basically the form would load
i would have a status bar that says "loading data"... and then the form
would then show the data once it's loaded

Any help would be greatly appreciated!
Chris Thunell
ct******@pierceassociates.com

Nov 22 '05 #4

I think the best way is to put a timer control on a form. so when form is
loaded, timer control will start and put your codes there.
you can set any timerinterval for that timer which in my perspective is the
best solution for your question.

"Mona" <mo**@discussions.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hi Chris,
How are you doing?

I would suggest you to start your project with a form with a progress or
some message informing the users that the application is loading
and in this form put up the code for loading your real form. When the real
form has completed loading you may place the first startup form
to hide/unload in the real form's activate event.

I hope this is helpful.
Thanks
Mona
[Grapecity]

"Chris Thunell" <ct******@pierceassociates.com> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
Right now I have a vb.net windows form project that does a whole bunch of
things on the form.load event. The problem with this is that the user

does
not see the form until all the those things are done.

Is there a way for a form to be shown first AND THEN have it
automatically
start to run through my code? (perhaps a different event??? form.paint,
form.activate)

Right now... the form is running but the user can't see it, and so they

end
up clicking on the application to run again and the user thinks the

program
is slow... AND WE CAN'T HAVE THAT!!!! :)

I would like:
Basically the form would load
i would have a status bar that says "loading data"... and then the form
would then show the data once it's loaded

Any help would be greatly appreciated!
Chris Thunell
ct******@pierceassociates.com


Nov 22 '05 #5
Do you want your users to be able to interact with the form once it is
shown? If so, then you might want to look at spawning a new thread to
perform the long running process.

If the users should *not* interact with the form until after the
loading process has completed, then use one of the techniques posted by
other users but show a splash form to indicate that the program is
still loading.

Nov 22 '05 #6
To simply show the form before other processes run, I use this:
Me.Show()
Me.Refresh()
Application.DoEvents()

To indicate the form isn't yet ready for use, I prefer some kind of
status message combined with an hourglass.
sbpStatusBar_MessagePanel.Text = "Loading..."
Me.Cursor = Windows.Forms.Cursors.WaitCursor

Of course, to be certain these appear to the user, place them before
the Refresh() call.

HTH

Jeff J.

Nov 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11914
by: robert walker | last post by:
hi all, to my webapp named mrf, i have added load-on-startup tag to mrf\WEB-INF\web.xml so i added a snippet like so <servlet> <servlet-name>loadDbProperties</servlet-name>...
1
16048
by: Ray in HK | last post by:
What are the differences between LOAD DATA INFILE and LOAD DATA LOCAL INFILE ? I found some web hosting company do not allow using LOAD DATA INFILE but allow LOAD DATA LOCAL INFILE. The reason...
6
4298
by: JS | last post by:
EE instance DB2 v7.2.0 fixpack 3 on WIN2K. I select some data from a table A and write it to a file using the COALESCE function and whitespace as the null character: eg coalesce(col1, ' '). This...
3
4281
by: Prince Kumar | last post by:
When running LOAD with "ALLOW READ ACCESS", I get the following error if select is running againt the table (isolation UR). load.sql --------- db2 load from /u02/data/dly_d040817_test.dat of...
6
44471
by: Steve | last post by:
I'm playing with late binding and trying a very simple test to load an assembly In my "Host" application I have this code: <code> string modulePath =...
3
7159
by: db2udbgirl | last post by:
Env: DB2 UDB 8.2, AIX 5.3 While trying to load data (73 Million rows, Medium size table uses 4K tablespace) into a table using cursor it fails with "SQL0964C The transaction log for the database...
1
3805
by: dbagirltx | last post by:
We have done some testing with mixed and forgotten results. So I'm hoping that asking here can clarify some issues for us. Right now we do one weekly warm backup. Throughout the week there are...
1
5892
by: huyuhui | last post by:
The following is a question of LOAD utility. Question: How does the DB2 enforce table check constraints for data added to table with the LOAD utility? A. With the BUILD phase of LOAD B. With the...
2
14070
by: contractsup | last post by:
Environment: $ uname -a AIX <withheld2 5 000100614C00 $ db2level DB21085I Instance "<withheld>" uses "32" bits and DB2 code release "SQL08024" with level identifier "03050106"....
2
6548
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.