473,583 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

When is a form finished loading?


Using VB 2005 Beta.

I have a form containing a DataGirdView. The cell enter, cell validating,
row enter, row validating events have a good bit of code that gets excuted
for each of these events. I have noticed that when the form loads, each of
these events run 3 times, before the form is ready for interaction with the
user. I would like to set a boolean variable to true when the form first
starts loading and change it's value when the form is ready to be used.
Hopefully I can test the value of this variable before each of the events
and speed my load time up a bit. Thing is I can not find the event where I
should change the variable. I have tried FormLoaded, Activated, and
gotFocus, but the 4 events mentioned earlier still run at least once after
each of these events. Can someone tell me what the last event that a form
runs before it is ready for user interaction?
Thanks,

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.c om<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
2 8990
th*****@msala.n et wrote:
Using VB 2005 Beta.

I have a form containing a DataGirdView. The cell enter, cell validating,
row enter, row validating events have a good bit of code that gets excuted
for each of these events. I have noticed that when the form loads, each of
these events run 3 times, before the form is ready for interaction with the
user. I would like to set a boolean variable to true when the form first
starts loading and change it's value when the form is ready to be used.
Hopefully I can test the value of this variable before each of the events
and speed my load time up a bit. Thing is I can not find the event where I
should change the variable. I have tried FormLoaded, Activated, and
gotFocus, but the 4 events mentioned earlier still run at least once after
each of these events. Can someone tell me what the last event that a form
runs before it is ready for user interaction?
Thanks,

Thomas

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.c om<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access


If you want to run the item once when the form is ready to display do this

In Form_Load Event
Addhandler Mybase.Activate d, addressof Form_Activated

Sub Form_Activated( ....)
RemoveHandler Mybase.Activate d, addressof Form_Activated
'Do whatever you want to do once the form is ready show the first time

End Sub
Nov 21 '05 #2

Chris wrote:
th*****@msala.n et wrote: If you want to run the item once when the form is ready to display do this

In Form_Load Event
Addhandler Mybase.Activate d, addressof Form_Activated

Sub Form_Activated( ....)
RemoveHandler Mybase.Activate d, addressof Form_Activated
'Do whatever you want to do once the form is ready show the first time

End Sub


Firstly, in .Net 2.0, this is no longer necessary. A form has a new
event called "Shown" which is raised the first time a form is display
and never again.

Secondly, the OP wanted to make sure that none of his grid code
executed before the form was ready. The Load event should work fine
for this.

Nov 21 '05 #3

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

Similar topics

1
21284
by: BKM | last post by:
I've been using the following 2 ways to make sure my WebBrowser is finished loading a page before continuing with the next code. do:doevents:loop while WebBrowser.Busy do:doevents:loop until WebBrowser.ReadyState = STATE_COMPLETE (or something like that. I don't have the code in front of me) But, for some reason, occasionally the code...
1
1899
by: Andreas Leue | last post by:
Hi, I am writing a small, automated webapp-test-machine in javascript. It shall work with something like Mozilla/Netscape - IE is not a choice. In this context it is necessary to detect when a page finished loading - without having access to that foreign page and - without being in a parent-frame of that page I have consulted this group...
1
4796
by: Timmy | last post by:
Hi, I have some javascript that is within an iframe's src, however I do not want to execute it until the iframe's parent has finished loading. I have tried parent.window.onload = function() but that does not seem to wait, and then throws a "not implemnted error" If any one can help it is greatly appreciated.,
0
1454
by: Brian Rupert | last post by:
I'm running windows XP Pro SP2 with Visual Studio .net 2003. When I try to debug my ASP.net app, it goes into debug mode, but when I select Break All, I get this error message: Unable to break execution. Please wait until the debuggee has finished loading, then try again. Can someone tell me what I'm doing wrong? Thanks, Brian
0
1296
by: the_kiddie98 | last post by:
Hi, I have a C# project which handles web requests to a server. On my local machine, I can usually attach to aspnet_wp once and debug file (hitting breakpoints), however if I stop and want to attach again I need to close the VS ide and start it again. If I don't do this I no breakpoints are hit and if I try to break execution, i get a message...
4
1710
by: BerkshireGuy | last post by:
Is there an event that triggers as a form is loading? I want to display a "loading form" event as the form is loading since it tends to take 20 second or so to open. TIA Brian
3
6427
by: Neekos | last post by:
I'm programatically opening IE and i need my code to wait until the browser is finished loading before continuing. How do i make it wait? i tried: Do DoEvents Loop Until webBrowser1.Busy = False but this doesnt work.
4
4353
by: Thomas | last post by:
Hello, I don't know if such question was already posted but I didn't find anything through different posts. I have the Main MDI window with a StatusBar. Inside my StatusBar there is a ProgressBar. When I click on the menu in my MDI Parent, a child form is loaded. I would like to know if there is a way to increment a progressbar value...
1
2310
by: pkeerthi86 | last post by:
Which event do you use to run something after the page has finished loading?  onfinished  onload  onunload  oncomplete
0
8159
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. ...
0
8314
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7922
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
8185
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...
1
5689
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
5366
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
3836
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1147
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.