473,587 Members | 2,568 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Completely loaded and drawn?

I want to run something once my form in completely loaded and drawn but
running at the end of form load doesn't do I guess cause of the large
dataset fill and the form isn't fully loaded. Where can I stick some code
so that I can run it after the form in fully drawn and loaded? I was told
there is no real way to know when it is "completely " loaded?
Nov 21 '05 #1
10 4405
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I want to run something once my form in completely loaded and drawn but
running at the end of form load doesn't do I guess cause of the large
dataset fill and the form isn't fully loaded. Where can I stick some code
so that I can run it after the form in fully drawn and loaded? I was told
there is no real way to know when it is "completely " loaded?

Nov 21 '05 #2
I tried that and in my project the on activated was firing before my form
load was complete. I may be doing something wrong. Thanks

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I want to run something once my form in completely loaded and drawn but
running at the end of form load doesn't do I guess cause of the large
dataset fill and the form isn't fully loaded. Where can I stick some code so that I can run it after the form in fully drawn and loaded? I was told there is no real way to know when it is "completely " loaded?


Nov 21 '05 #3
Yes, just tried it again and put a debug at the end of my load and a debug
on activated with activated being debugged first then load?

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
I want to run something once my form in completely loaded and drawn but
running at the end of form load doesn't do I guess cause of the large
dataset fill and the form isn't fully loaded. Where can I stick some code so that I can run it after the form in fully drawn and loaded? I was told there is no real way to know when it is "completely " loaded?


Nov 21 '05 #4
Strange, I just tried and Load got debugged first then Activate...

(Haven't played around enough to see if the form was finished drawing yet
though...)

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
Yes, just tried it again and put a debug at the end of my load and a debug
on activated with activated being debugged first then load?

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>I want to run something once my form in completely loaded and drawn but
> running at the end of form load doesn't do I guess cause of the large
> dataset fill and the form isn't fully loaded. Where can I stick some code > so that I can run it after the form in fully drawn and loaded? I was told > there is no real way to know when it is "completely " loaded?
>
>



Nov 21 '05 #5
The Load Event should fire before the Activated Event. What code are you
running in the load event? If you are loading a dataset as you say then you
should use a seperate thread to do that instead of the load event.
"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
I tried that and in my project the on activated was firing before my form
load was complete. I may be doing something wrong. Thanks

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>I want to run something once my form in completely loaded and drawn but
> running at the end of form load doesn't do I guess cause of the large
> dataset fill and the form isn't fully loaded. Where can I stick some code > so that I can run it after the form in fully drawn and loaded? I was told > there is no real way to know when it is "completely " loaded?
>
>



Nov 21 '05 #6
I get the username and the fill a dataset.

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
The Load Event should fire before the Activated Event. What code are you
running in the load event? If you are loading a dataset as you say then you should use a seperate thread to do that instead of the load event.
"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP15.phx.gbl.. .
I tried that and in my project the on activated was firing before my form
load was complete. I may be doing something wrong. Thanks

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>I want to run something once my form in completely loaded and drawn but > running at the end of form load doesn't do I guess cause of the large
> dataset fill and the form isn't fully loaded. Where can I stick some

code
> so that I can run it after the form in fully drawn and loaded? I was

told
> there is no real way to know when it is "completely " loaded?
>
>



Nov 21 '05 #7
It's probably right but I'm putting it at then end of my form load, which
fills my dataset which must be why the activated is firing first? Don't
know but it is doing it.

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:eW******** ******@TK2MSFTN GP09.phx.gbl...
Strange, I just tried and Load got debugged first then Activate...

(Haven't played around enough to see if the form was finished drawing yet
though...)

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
Yes, just tried it again and put a debug at the end of my load and a debug on activated with activated being debugged first then load?

"Think_Fast " <nospam@haha> wrote in message
news:10******** *****@corp.supe rnews.com...
You could put it in tne form Activated Event.

'-- Use this only if you want to run it only one time
Dim run_once As Boolean
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Activate d
If Not run_once Then
'--- Do whatever you want
run_once = True
End If
End Sub

"B-Dog" <bd***@hotmail. com> wrote in message
news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>I want to run something once my form in completely loaded and drawn but > running at the end of form load doesn't do I guess cause of the large
> dataset fill and the form isn't fully loaded. Where can I stick some

code
> so that I can run it after the form in fully drawn and loaded? I was

told
> there is no real way to know when it is "completely " loaded?
>
>



Nov 21 '05 #8
I didn't think it was multi-threaded like that (is that even the term?)

I didn't think Active event could be called prior to the Load event
finishing...

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:Os******** ********@TK2MSF TNGP10.phx.gbl. ..
It's probably right but I'm putting it at then end of my form load, which
fills my dataset which must be why the activated is firing first? Don't
know but it is doing it.

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:eW******** ******@TK2MSFTN GP09.phx.gbl...
Strange, I just tried and Load got debugged first then Activate...

(Haven't played around enough to see if the form was finished drawing yet
though...)

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
> Yes, just tried it again and put a debug at the end of my load and a debug > on activated with activated being debugged first then load?
>
> "Think_Fast " <nospam@haha> wrote in message
> news:10******** *****@corp.supe rnews.com...
>> You could put it in tne form Activated Event.
>>
>> '-- Use this only if you want to run it only one time
>> Dim run_once As Boolean
>> Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
>> System.EventArg s) Handles MyBase.Activate d
>> If Not run_once Then
>> '--- Do whatever you want
>> run_once = True
>> End If
>> End Sub
>>
>>
>>
>> "B-Dog" <bd***@hotmail. com> wrote in message
>> news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>> >I want to run something once my form in completely loaded and drawn but >> > running at the end of form load doesn't do I guess cause of the
>> > large
>> > dataset fill and the form isn't fully loaded. Where can I stick
>> > some
> code
>> > so that I can run it after the form in fully drawn and loaded? I
>> > was
> told
>> > there is no real way to know when it is "completely " loaded?
>> >
>> >
>>
>>
>
>



Nov 21 '05 #9
But I think dataset fills command are sent as a separate thread so it
continues on but in reality, depending on the size of the data it is filling
it still processing. Can't do anything on my form till it is done filling
and the form thinks it is done.

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:u2******** ******@TK2MSFTN GP10.phx.gbl...
I didn't think it was multi-threaded like that (is that even the term?)

I didn't think Active event could be called prior to the Load event
finishing...

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:Os******** ********@TK2MSF TNGP10.phx.gbl. ..
It's probably right but I'm putting it at then end of my form load, which fills my dataset which must be why the activated is firing first? Don't
know but it is doing it.

"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:eW******** ******@TK2MSFTN GP09.phx.gbl...
Strange, I just tried and Load got debugged first then Activate...

(Haven't played around enough to see if the form was finished drawing yet though...)

Greg

"B-Dog" <bd***@hotmail. com> wrote in message
news:OW******** ******@TK2MSFTN GP15.phx.gbl...
> Yes, just tried it again and put a debug at the end of my load and a

debug
> on activated with activated being debugged first then load?
>
> "Think_Fast " <nospam@haha> wrote in message
> news:10******** *****@corp.supe rnews.com...
>> You could put it in tne form Activated Event.
>>
>> '-- Use this only if you want to run it only one time
>> Dim run_once As Boolean
>> Private Sub Form1_Activated (ByVal sender As Object, ByVal e As
>> System.EventArg s) Handles MyBase.Activate d
>> If Not run_once Then
>> '--- Do whatever you want
>> run_once = True
>> End If
>> End Sub
>>
>>
>>
>> "B-Dog" <bd***@hotmail. com> wrote in message
>> news:%2******** *******@TK2MSFT NGP10.phx.gbl.. .
>> >I want to run something once my form in completely loaded and drawn

but
>> > running at the end of form load doesn't do I guess cause of the
>> > large
>> > dataset fill and the form isn't fully loaded. Where can I stick
>> > some
> code
>> > so that I can run it after the form in fully drawn and loaded? I
>> > was
> told
>> > there is no real way to know when it is "completely " loaded?
>> >
>> >
>>
>>
>
>



Nov 21 '05 #10

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

Similar topics

4
2767
by: Carolina | last post by:
Hi. I have a MDIchild form called Form1. In Form1_Load code, the form populates a Listview control based on a datareader, but I want to close the form inmediately and return to the parent form, if there was a problem connecting to the database and populating the Listview control. I've tried something like this:
1
1471
by: Marc Bogaard | last post by:
Hello together! Is there any event avaible in Javascript that raises when the site or in my case a text is completely loaded? Is need this because the visitor should only be allowed to press a button when the privacy text is visible. thank you in advance marc
2
5189
by: Edward | last post by:
I have the following function to determine if a form is loaded: Public Function modIsloaded(ByVal vstrFormName As String) As Boolean ' Error handling removed for concision ' Determine if form open modIsloaded = False If (SysCmd(acSysCmdGetObjectState, acForm, vstrFormName) = acObjStateOpen) Then
2
22646
by: David N | last post by:
Hi All, The OnLoad() event is invoked automatically when a form is being loaded. Do we have another event that is invoked automatically after a form has completed loading? Thanks.
4
1917
by: Aung Thu | last post by:
Hi, there! I want to set focus on a control, of which TabIndex is not the first, when a form is loaded. In the form's load event, I have used Control.Focus() but it doesn't not work. The focus is not on the control I set. The focus is always on the control of which TabIndex is 0. Thanks.
2
11781
by: sumuka | last post by:
Hello, I'm doing a vb6 project in which i've a flexgrid and when the user clicks on the 3rd column 1st row a new form (frm.edit) will open and this form displays some data now when i want click the next row i will have to close the frm.edit. But i want to check whether the form is loaded and if it's loaded then i should be able to click on...
3
1269
by: muddasirmunir | last post by:
how can we know that the form is loaded or not. just like other control like recorset we can check by this code whether the recorset is open or not if recordset.state= 1 then (do some work) how can we check if form1.state= 1 then(there is no form1.state object ) so how can we know that form is loaded or not
3
1751
by: emtang | last post by:
How to refresh to original when form is loaded after the user right click sort Steps: 1. Form is loaded. 2. User right click on sort A-Z in Contributor. 3. User wants to get back the original sort when the form is opened. How? Please help
0
7918
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...
0
7843
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...
0
8206
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
8220
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
5713
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
5392
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
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
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
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.