473,486 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why does ISerialize.EndInit() cause UserControl1_Load() to be called?

Can anyone explain the following behaviour?

Create a new, blank project, and place an ActiveX control (e.g. WebBrowser
control) on Form1. Now run the solution.

The sequence of events is:

Form1.New() begins
Form1.New() ends
Form1_Load() called
....

Now create a user control and put the ActiveX control on it. Put the user
control on Form1 instead of the ActiveX control. Now run the solution.

The sequence of events is:

Form1.New() begins
UserControl1. New() begins
UserControl1_Load() begins
UserControl1_Load() ends
UserControl1. New() ends
Form1.New() ends
Form1_Load() called
....

The two behaviours do not seem consistent. Is this what people would expect
to happen?

I would expect something like

Form1.New() begins
UserControl1. New() begins
UserControl1. New() ends
UserControl1_Load() begins
UserControl1_Load() ends
Form1.New() ends
Form1_Load() called
....

TIA

Charles
Nov 20 '05 #1
3 1434
Hi Charles,

If only you could take an Ax to that AxBrowser!! ;-)

I've kept away for fearing giving you the 'Kiss of Death', lol, but it is
the subject matter, I'm afraid.

Again, I have no solution, but there's an article about DesignMode that
may shed a couple of Watts into a murky corner.
http://msdn.microsoft.com/library/de.../dnwinforms/ht
ml/designtimedebugging.asp

I found the Chain of Events part quite illuminating in fact - simulated
InitializeComponent indeed, lol!

Regards,
Fergus
Nov 20 '05 #2
Hi Fergus

If I had known when I started what I know now ...

The answer has to be for someone to write a managed wrapper for mshtml and
shdocvw, probably in C#. I know there are some attempts out there, but so
far I haven't found a complete solution that implements all the things that
I have now added to my own control, e.g. visible, sizeable, snappable grid,
visual column and row sizing of tables, and others.

Thanks for the link; I will take a look.

Cheers

Charles
"Fergus Cooney" <fi******@tesco.net> wrote in message
news:eR**************@tk2msftngp13.phx.gbl...
Hi Charles,

If only you could take an Ax to that AxBrowser!! ;-)

I've kept away for fearing giving you the 'Kiss of Death', lol, but it is the subject matter, I'm afraid.

Again, I have no solution, but there's an article about DesignMode that may shed a couple of Watts into a murky corner.
http://msdn.microsoft.com/library/de.../dnwinforms/ht ml/designtimedebugging.asp

I found the Chain of Events part quite illuminating in fact - simulated InitializeComponent indeed, lol!

Regards,
Fergus

Nov 20 '05 #3
Hi again,

There's also this one. I've not fully read it yet, but it talks about
Sites, DesignMode and a bit about ISupportInitialize.

Building Windows Forms Controls and Components with Rich Design-Time Features
http://msdn.microsoft.com/msdnmag/is...ls/default.asp
x

Regards,
Fergus
Nov 20 '05 #4

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

Similar topics

0
1524
by: Lecture Snoddddgrass | last post by:
Hi, I noticed that my WinForms app was taking a while to start up. I stepped through the code to find out which line was causing the delay. The delay is occurring within one of my UserControls...
3
11855
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a...
5
3667
by: Nadav | last post by:
Hi, I am using FileStream's Async API: BeginRead/EndRead, upon completion callback execution I use the read data and call EndRead, Taking that in mind, I Wonder... does calling EndRead will cause...
4
18084
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
2
1493
by: Joe Fallon | last post by:
I have a Shared class with a New constructor that initializes some Shared properties. One of the steps involves a hit to the database. My tests show that when called by a WinForms app, the...
1
7819
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
55
6149
by: Zytan | last post by:
I see that static is more restricted in C# than in C++. It appears usable only on classes and methods, and data members, but cannot be created within a method itself. Surely this is possible in...
71
10667
by: active | last post by:
In the main program I check to see if a certain form has been disposed. Does it make sense in that form's FormClosed event to do: Me.Dispose to make sure it is disposed the next time I check. Or...
4
1705
by: eBob.com | last post by:
In my class which contains the code for my worker thread I have ... Public MustInherit Class Base_Miner #Region " Delegates for accessing main UI form " Delegate Sub DelegAddProgressBar(ByVal...
0
6964
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
7123
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,...
1
6839
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
7305
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...
0
4559
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...
0
3066
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...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
muto222
php
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.