Results 1 to 5 of 5

Thread: components?classes?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    components?classes?

    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 ...

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    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 .

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    little mistake there, what i ment was acctualy controls vs components


    thanks

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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).
    Last edited by Edneeis; Apr 13th, 2004 at 11:49 PM.

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Components like : Timers , FileSystemWatcher , ..etc
    Controls like : Buttons , ListBox , ComboBox,Menus ...etc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width