473,609 Members | 1,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does ISerialize.EndI nit() cause UserControl1_Lo ad() 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_Lo ad() begins
UserControl1_Lo ad() 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_Lo ad() begins
UserControl1_Lo ad() ends
Form1.New() ends
Form1_Load() called
....

TIA

Charles
Nov 20 '05 #1
3 1439
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/designtimedebug ging.asp

I found the Chain of Events part quite illuminating in fact - simulated
InitializeCompo nent 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******** ******@tk2msftn gp13.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/designtimedebug ging.asp

I found the Chain of Events part quite illuminating in fact - simulated InitializeCompo nent 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 ISupportInitial ize.

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
1541
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 whose designer-generated InitializeComponent() method instantiates a web browser control and eventually calls EndInit() on it. It's that EndInit() call that takes several seconds to complete. What's odd is that my application makes extensive use...
3
11872
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 to-be-developed-function cmdOkay_Click() function as described below. 1. Create an user control that contains an OK button as below Public Class MyButton:System.Windows.Form.UserControl
5
3683
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 a context switch? What is the kernel object used for blocking EndRead calls? Event and mutex cause a context switch even when the object is signaled and no wait is needed, usage of critical section prevent this switch from happening... what is the...
4
18106
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 as I find appropriate. I am using the socket asynchronously by calling the BeingSend and BeginReceive calls. I would like to be able to call shutdown and close asynchronously if possible.
2
1502
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 constructor only runs once. All calls to the class after this do not casues the construtor to run again. This means it is a one time hit to the database to load these properties. 1. Can someone confirm this?
1
7829
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 am note sure what to do because all propertiers work, except the System.Data.DataColumn.. I didn't write any code by hand and used the visual studio to set the properties..
55
6188
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 C# in some way? Or maybe no, because it is similar to a global variable (with its scope restricted) which C# is dead against? Zytan
71
10715
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 is that automatic? Thanks
4
1716
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 uiform As Form1, ByRef si As MTCC02.Form1.SiteRunOpts, _ ByVal numitems As Integer) #End Region
0
8130
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8222
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7002
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6057
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2531
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
1672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1389
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.