Sorry to confuse you.
A class is a class.
A component is a class that implements the IComponent interface.
If you want to take advantage of the drag & drop, toolbox and visual
designers, you implement a component. If you only want to use this thing
directly from code, just write a regular class.
Components can be used from code (call new, write code to set properties)
just like a class can. Components also allow for the drag & drop tools.
When writing code just for you, just write a class. If you're writing a
library for somebody else, it's often helpful to do the extra step to allow
the drag & drop. Makes the client's life a bit easier.
-Chris
-----Original Message-----
From: srinivas n [mailto:sriprog@xxxxxxxxx]
Sent: Wednesday, December 22, 2004 3:05 PM
To: padnug@xxxxxxxxxxxxxxx
Subject: RE: [padnug] User Control Vs components
thanks but still a bit confused .......
do you mean to say that there is no difference between a "Class" and a
"component" except that a component can be dragged and dropped........
in that case why bother creating a component ( implementing Icomponent
interface)when everything we write is objectoriented ...dont you guys think
we are better of writing regular classes and create an instance of that
class when needed (Am I missing something?)
------------------------------------
- create a component for re-usable non-UI objects that you want to be able
to add to the VS.NET toolbox and have visual designers for
- create a class for re-usable non-UI objects that don't need to be
dragged/dropped/designable
thanks
sri
------------------------ Yahoo! Groups Sponsor --------------------~-->
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/dpFolB/TM
--------------------------------------------------------------------~->
|