473,657 Members | 2,513 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 3516
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
11921
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
16065
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
4310
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 into table B which has not null constraint on col1: LOAD FROM LOAD.TEST OF ASC MODIFIED BY...
3
4305
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 /u02/load/msg/auth_detail.msg \
6
44482
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
7183
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 cursor for select CAST(PARTITIONING_NBR AS CHAR(10)), VEH_IDENT_NBR, OPTN_CD, VIN_TYPE_CD,...
1
3816
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 happens when a table is loaded unrecoverable and then we need to restore (no DDL has been done)? Can we...
1
5940
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
14111
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
6554
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 password. I also added the NETWORK SERVICE user to the DB.
0
8421
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8325
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8518
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8621
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6177
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5643
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1734
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.