Differences Control vs UserControl
-
I would like to know the differences between deriving from Control or UserControl when you are building a custom control. I know that is easier to create if you use UserControl because you can drag&drop (like into a form) but, is there any other difference? I am particularly worried about run & design time. Thanks in advance. Ivan. Iván Fernández
-
I would like to know the differences between deriving from Control or UserControl when you are building a custom control. I know that is easier to create if you use UserControl because you can drag&drop (like into a form) but, is there any other difference? I am particularly worried about run & design time. Thanks in advance. Ivan. Iván Fernández
A big difference is designer support. UserControls have designer support right out of the box. Custom controls dont. It kind of depends on what you are doing. If you just need to make a composite control (ie. label and textbox) then use UserControl. If you need to do basic custom painting just do that in the paint events or overide OnPaint... For more advanced programming use Control. I've done a huge amount of UI work, so tell me what kind of control you are making and I'll give you advice on how to implement it. ***** And delete your duplicate posting please. This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy
-
A big difference is designer support. UserControls have designer support right out of the box. Custom controls dont. It kind of depends on what you are doing. If you just need to make a composite control (ie. label and textbox) then use UserControl. If you need to do basic custom painting just do that in the paint events or overide OnPaint... For more advanced programming use Control. I've done a huge amount of UI work, so tell me what kind of control you are making and I'll give you advice on how to implement it. ***** And delete your duplicate posting please. This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy
-
That's not exactly a composit control. That's just controls grouped together in a panel. Composit control is something you can put in your toolbox and reuse. This posting is provided "AS IS" with no warranties, and confers no rights. Alex Korchemniy