locked
Control and Component RRS feed

  • Question

  • Hi

    I am beginner learning C#.

    Can any one explain me what is the difference between User-Defined Component and User-Defined Control?
    • Moved by CoolDadTx Monday, April 6, 2009 1:28 PM WinForms related
    Friday, April 3, 2009 8:53 AM

Answers

  • The term component in the software industry is often used to refer to a reusable object that exposes one or more interfaces to clients in a standardized way. A component may be implemented as a single class, or as a set of classes; the primary requirement is that the basic public interface be well-defined.

    http://msdn.microsoft.com/en-us/library/ms228287(VS.80).aspx

    User control example

    http://www.dotnetspider.com/resources/2458-C-User-Control-an-Example.aspx
    Thanks, A.m.a.L | [Remember to click "mark as answered" when you get a correct reply to your question]
    • Proposed as answer by Kira Qian Tuesday, April 7, 2009 3:43 AM
    • Marked as answer by Kira Qian Thursday, April 9, 2009 8:02 AM
    Friday, April 3, 2009 12:58 PM
  • Use a Control if you want something visible at runtime.  Use a Component when you just want to take advantage of the Properties window in the designer.  Components can have a visible runtime presentation too, but that takes a *lot* of code.
    Hans Passant.
    • Proposed as answer by Kira Qian Tuesday, April 7, 2009 3:43 AM
    • Marked as answer by Kira Qian Thursday, April 9, 2009 8:02 AM
    Tuesday, April 7, 2009 1:33 AM

All replies

  • The term component in the software industry is often used to refer to a reusable object that exposes one or more interfaces to clients in a standardized way. A component may be implemented as a single class, or as a set of classes; the primary requirement is that the basic public interface be well-defined.

    http://msdn.microsoft.com/en-us/library/ms228287(VS.80).aspx

    User control example

    http://www.dotnetspider.com/resources/2458-C-User-Control-an-Example.aspx
    Thanks, A.m.a.L | [Remember to click "mark as answered" when you get a correct reply to your question]
    • Proposed as answer by Kira Qian Tuesday, April 7, 2009 3:43 AM
    • Marked as answer by Kira Qian Thursday, April 9, 2009 8:02 AM
    Friday, April 3, 2009 12:58 PM
  • Use a Control if you want something visible at runtime.  Use a Component when you just want to take advantage of the Properties window in the designer.  Components can have a visible runtime presentation too, but that takes a *lot* of code.
    Hans Passant.
    • Proposed as answer by Kira Qian Tuesday, April 7, 2009 3:43 AM
    • Marked as answer by Kira Qian Thursday, April 9, 2009 8:02 AM
    Tuesday, April 7, 2009 1:33 AM