473,587 Members | 2,489 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******@pierce associates.com
Nov 22 '05 #1
6 3508
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******@pierc eassociates.com > wrote in message
news:Oa******** ******@TK2MSFTN GP09.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******@pierce associates.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**@discussio ns.com> wrote in message
news:%2******** ********@tk2msf tngp13.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******@pierc eassociates.com > wrote in message
news:Oa******** ******@TK2MSFTN GP09.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******@pierce associates.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.DoE vents()

To indicate the form isn't yet ready for use, I prefer some kind of
status message combined with an hourglass.
sbpStatusBar_Me ssagePanel.Text = "Loading... "
Me.Cursor = Windows.Forms.C ursors.WaitCurs or

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
11920
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> <servlet-class>mrf.LoadDbPropertiesServlet</servlet-class>
1
16056
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 is for the sake of security. What does that mean ?
6
4306
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 column has 10,000 nulls in table A. Select count(*) from table A where col1 is null=10,000 Using the load utlity, I load the data file as follows...
3
4298
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 asc \ modified by implieddecimal nullindchar=Y \ fastparse anyorder \ METHOD L \(01 10,11 12,13 15,16 24,25 28,29 48,49 64\) \ MESSAGES...
6
44475
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 = @"C:\PMDRepository\Tools\ManfBusProcMgr\Modules\TestModule\bin\Debug\TestModule"; Assembly a = Assembly.Load(modulePath); </code>
3
7175
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 is full. SQLSTATE=57011" But I felt that Load utility wont log any acvitities on the database. Here it what I tried to do db2 "declare c1 ...
1
3813
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 multiple unrecoverable loads. We are tyring to come up with the best backup strategy for this system? It is a large dev data warehouse. What...
1
5930
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 SET INTEGRITY statement C. With the DELETE phase of the LOAD D. With the UPDATE CONSTRAINTS statement Answer is A
2
14092
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". Informational tokens are "DB2 v8.1.1.104", "s060120", "U805924", and
2
6552
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 converted to an application running in ..NET 2.X and Integrated mode. We copied over the DB and edited the web.config file to the DB username and...
0
8216
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7974
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5719
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5395
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
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 we have to send another system
0
1192
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.