These are three different things you can add to a project and I am not quite sure if I understand the difference. They all seem to for example show up in the component toolbox when working with a Form
. What are some common usage scenarios for each of them? What is the difference?

- 152,914
- 173
- 462
- 620
4 Answers
The main difference between User Control, Custom Control and Component is that they inherit from different levels in the inheritance tree:
MyComponent
|-> Component
MyCustomControl
|-> Control
|-> Component
MyUserControl
|-> ContainerControl
|-> ScrollableControl
|-> Control
|-> Component
So, in short you get a different amount of pre-wired functionality with the different options.
When would you use the different options? (these are thoughts and opinions, not truths)
- Create a component if you want to provide functionality without UI (such as Timer components, data sources, ...)
- Create a custom control if you want to make a component where you have full control over its visual appearance, and you don't want any baggage of unnecessary functionality. Typical cases would be simple controls with limited functionality (such as a button)
- Create a user control if you are going to combine existing controls into reusable building blocks (such as two lists with buttons where you can move items between the lists).

- 155,851
- 29
- 291
- 343
-
17Yeah, it took me a while to figure out, but it seems a `UserControl` is really a "composite" control (a control made out of other controls), whereas a custom control is really a user-designed control. – Dave Cousineau Jun 29 '12 at 19:07
-
If want to create a control consisting of several TextBoxes with custom- and dynamically-drawn graphics between them, should I choose `UserControl` ? – Nick Alexeev Oct 21 '14 at 05:31
-
@NickAlexeev I haven't worked much in the winforms world since a few years back, but I believe that would be the way to go, yes. – Fredrik Mörk Oct 21 '14 at 05:59
-
2@FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls? – John Odom Jun 01 '15 at 22:46
-
1@John Odom AngelSix series on youtube is the one to go with. I checked and I know it is in video 9 and to be specific he used it at 26:00 – Mour_Ka Oct 27 '20 at 06:54
Adding to what Fredrik said, generally components and custom controls would be used when you plan on reusing them across projects. Use user controls when you would only be using it in one project.

- 1,404
- 1
- 18
- 29
-
10Why so? A benefit to use an user control in a single project, a limitation of it to be used in several projects...? – Camilo Martin Dec 06 '11 at 02:57
I believe the last statement is not correct in my opinion . I create user controls for many different reasons.
The main reason is so that if per say I design an interface of multiple controls grouped together.
I first create a class library , then I add user controls to it . Now if i need to change any part of the logic behind how the user control works I can very easily. Also this class library can be used multiple times.
Also within the same classy library I can have multiple classes that can be shared and used for any of my user controls.
This is the main reason I use user controls. And if you make a change to your user control or class library . once you build the job . the dll will dynamically up date in the bin folder .
So if i am referencing this in another project Those changes will also appear in new project .
Also it doesn't use the same paint routines as the form and anything you have loaded on the form.
So user controls gives us the ability to be very modular And i Can have multiple user controls that share the basics classes of the class library ... So a user control purpose is just not for one project . It has no limitations in that respect. jeff

- 19
- 4
-
Re *"I believe the last statement is not correct in my opinion"* - the last statement of *what*? [And it would be best to quote the statement in your answer, so readers immediately know what you are referring to.] – ToolmakerSteve Mar 17 '19 at 15:31
-
This doesn't appear to be an answer to the question, but rather a comment on someone else's answer. – dynamichael Jul 24 '22 at 01:18
The main difference between them- User Control is a page file with extension .ascx which can only be used within a single application or project But custom controls are assemblies(dll files) that can be used in multiple applications.

- 27
- 5