Windows Develop Bookmark and Share   
 index > Windows Forms General > Component/Control différences
 

Component/Control différences

I don't really understand the difference between a component and a control, as it seems that both can be used to create a user control, for example.
Can somebody explain that to me ?
Thanks
Emphyrio

Emphyrio  Wednesday, August 24, 2005 9:17 AM
If you want to create an object that the user can interact with, then you need to create a control, if you want provide custom behaviour to a form that doesn't necessarily have a user interface, then use a component.

To create a ComboBox with images, you wouldn't go and create a new control, you would derive from the existing ComboBox class and override functionality to provide custom drawing.
David M. Kean  Wednesday, August 24, 2005 11:16 AM
Controls are derived from Component. The basic difference though is that components don't have a user interface, for example the OpenFileDialog or ErrorProvider.
Daniel Rieck  Wednesday, August 24, 2005 9:39 AM
Thank you for your answer. It's clear !
So if I want to create a control (actually a ComboBox with images). I am supposed to create a Control and not a component, is that it ?
Do I have any advantage in creating either a component or a control ?

Emphyrio
Emphyrio  Wednesday, August 24, 2005 11:01 AM
If you want to create an object that the user can interact with, then you need to create a control, if you want provide custom behaviour to a form that doesn't necessarily have a user interface, then use a component.

To create a ComboBox with images, you wouldn't go and create a new control, you would derive from the existing ComboBox class and override functionality to provide custom drawing.
David M. Kean  Wednesday, August 24, 2005 11:16 AM

You can use google to search for other answers

Custom Search

More Threads

• event to update the database once the report is printed
• 'System.IO.FileLoadException'
• ReleaseDC
• Advice Request: Printing a government form with data
• Reset text and not move the carriage
• Color Blindness
• Projects organization
• KeyDown processing of Arrow + Modifier very messy
• Probelem While Sending the Arrow Down key using post message.
• UnhandledException & ThreadException from Windows Control