473,542 Members | 2,693 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 4396
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
2764
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
1468
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
5186
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
22643
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
1914
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
11762
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
1268
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
1748
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
7397
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
7726
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
7329
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
7675
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
3384
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...
0
3385
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1809
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
948
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
626
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.