473,408 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

what is IContainer components for?

When I create a new form a private member
System.ComponentModel.Container 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 12834
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**@discussions.microsoft.com> wrote in message
news:2C**********************************@microsof t.com...
When I create a new form a private member
System.ComponentModel.Container 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
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...
1
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...
2
by: Julia | last post by:
Hi, What is excatly the difference between framework components and application components?
9
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...
2
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: ...
4
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...
21
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...
3
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...
1
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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
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...

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.