473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3487
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
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
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
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
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
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.