473,396 Members | 2,158 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,396 software developers and data experts.

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.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
Nov 21 '05 #1
2 8948
th*****@msala.net 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.com<<<<<<------
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.Activated, addressof Form_Activated

Sub Form_Activated(....)
RemoveHandler Mybase.Activated, 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.net wrote: If you want to run the item once when the form is ready to display do this

In Form_Load Event
Addhandler Mybase.Activated, addressof Form_Activated

Sub Form_Activated(....)
RemoveHandler Mybase.Activated, 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
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...
1
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...
1
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()...
0
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...
0
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...
4
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
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 =...
4
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...
1
by: pkeerthi86 | last post by:
Which event do you use to run something after the page has finished loading?  onfinished  onload  onunload  oncomplete
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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...
0
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,...

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.