473,691 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

what is IContainer components for?

When I create a new form a private member
System.Componen tModel.Containe r components
is created, and appears to be passed to the constructors of various things
like timers.
Can someone explain to me what the purpose of this is. It seems to have
something to do with the Dispose method. If I create (say) a timer manually
in the code and don't pass the components object in the constructor
everything still seems to work OK.
--
Dave
Jan 25 '06 #1
1 12878
Dave,

some of the components hold on unmanaged resources that needs to be released
upon destroing the component. Forms and UserControls use the container
collection to keep track of such components so they get disposed along with
the form or user control.

Beside this IContainer component collection are used in design time by the
desingener host to keep track of all objects on the design surface. However
it has nothing to do with the Container object that you see in the Form
class.
--
HTH
Stoitcho Goutsev (100)

"Dave" <Da**@discussio ns.microsoft.co m> wrote in message
news:2C******** *************** ***********@mic rosoft.com...
When I create a new form a private member
System.Componen tModel.Containe r components
is created, and appears to be passed to the constructors of various things
like timers.
Can someone explain to me what the purpose of this is. It seems to have
something to do with the Dispose method. If I create (say) a timer
manually
in the code and don't pass the components object in the constructor
everything still seems to work OK.
--
Dave

Jan 25 '06 #2

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

Similar topics

26
4469
by: Lasse Edsvik | last post by:
Hello I'm trying to build a simple COM+ app in vs.net using C# and i cant register it in component manager..... what more is needed than this: using System; using System.EnterpriseServices;
1
3972
by: Francois Vanderseypen | last post by:
Why is it that the Form class does not implement the IContainer interface? It inherits from ContainerControl but components are attached to the 'components' field via the generated private System.ComponentModel.Container components = null; statement. Said differently, when should I implement the IContainer interface? Thanks a lot!
2
1753
by: Julia | last post by:
Hi, What is excatly the difference between framework components and application components?
9
2820
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form based "Smart
2
3517
by: Oberon | last post by:
Why does this not work as it should? I expect index.aspx to show:. Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\inetpub\wwwroot\ChatSimple\db\chatusers.mdb Instead, I get: Provider=Microsoft.Jet.OLEDB.4.0;Data
4
1097
by: SamSpade | last post by:
I Picture an Interface as a list of references to methods and properties. It's nothing except a spec. until it is implemented. if that is so what is "components"? Private components As System.ComponentModel.IContainer If it's an inteface where is the implementation?
21
5207
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each table and 11 sub items with data about each column. When a Row in ListView1 is selected the Data in ListVies2 is loaded to show the correct data. Initially the first row in ListView1 is selected in FormX load
3
1022
by: tcloud | last post by:
Fired up VS 2003 this morning, editing VB application and now I cannot open Design View and Code View at the same time. If I select "view code" while in Design View, the code appears, but there is no tab to switch back to Design View. If I double-click the vb app, the Design View replaces the code window and tab. I work on this at two different computers -- everything was okay yesterday on the other computer.
1
3522
by: D2 | last post by:
Hi, I need to find all the non-ui controls like errorproviders that have been dropped in the form. Unlike form.controls property, I dont see any collection that maintains all the non-ui controls dropped in the form. After scanning various posts on the newsgroups, I came to know that these are maintained in the following member variable (declared in the designer file):
0
9079
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8951
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8791
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
7623
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
6457
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
5813
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2965
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
3
1952
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.