By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,674 Members | 1,478 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,674 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.