whates the differenct between components and collections?
as far as i know we create objects out of both of them.
component can be added to the control bar, classes cant , is that the only difference?
thanks ...
Printable View
whates the differenct between components and collections?
as far as i know we create objects out of both of them.
component can be added to the control bar, classes cant , is that the only difference?
thanks ...
Components in .NET is customized classes that have some extra generated code related to the inherited base classes and for creating controls and components that will be used on forms or whatever container, Classes are classes :D .
little mistake there, what i ment was acctualy controls vs components
thanks
First lets be technical for a moment. Components, Controls, and just about everything else are all really just classes/objects. The difference between a Component Class and a Control Class are what it inherits from. A Component is a basic object which implements the IComponent interface. A Control is derived from Component but also implements many Interfaces in order to be a Window as well. So all controls are components, but not all components are controls. Now what that means in english is that a Component is an object with the necessary structure and functionality to do shown in the IDE at designtime but does not implement that it can be hosted by other objects such as a form (or act as a 'window'). A Control has all of the functionality of a Component but also all of the functionality and stucture to be hosted on a form or other container control or object and can be a 'window'.
You can see the inheritance structure of an object by viewing it in the Object Browser (Ctrl+Alt+J).
Components like : Timers , FileSystemWatcher , ..etc
Controls like : Buttons , ListBox , ComboBox,Menus ...etc