What is the difference between User Control, Custom Control and Component?









up vote
72
down vote

favorite
30












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?










share|improve this question

























    up vote
    72
    down vote

    favorite
    30












    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?










    share|improve this question























      up vote
      72
      down vote

      favorite
      30









      up vote
      72
      down vote

      favorite
      30






      30





      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?










      share|improve this question













      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?







      c# winforms controls components






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 24 '09 at 13:33









      Svish

      63.1k143379544




      63.1k143379544






















          5 Answers
          5






          active

          oldest

          votes

















          up vote
          140
          down vote



          accepted










          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).





          share|improve this answer


















          • 11




            Yeah, 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 5: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 5:59







          • 1




            @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
            – John Odom
            Jun 1 '15 at 22:46

















          up vote
          4
          down vote













          This is some difference between a CustomControl and a UserControl :



          Custom Control



          A loosely coupled control w.r.t code and UI



          Derives from Control



          Defines UI in a ResourceDictionary



          UI is skinable



          Has dynamic layout



          UI can be changed in different projects



          Has full toolbox support



          Defines a single control



          More flexible



          ==============



          User Control



          A tightly coupled control w.r.t code and UI



          Derives from UserControl



          Defines UI as normal XAML



          Child controls are skinable



          Has static layout



          UI is fixed and can't have different looks in different project



          Can't be added to the toolbox



          Defines a set of controls



          Not very flexible like a Custom Control






          share|improve this answer




















          • I don't agree with : Can't be added to the toolbox
            – Jagoda Sokół
            Jul 12 '17 at 9:29






          • 2




            At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
            – user3265613
            May 31 at 13:16










          • This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
            – Sebastian Negraszus
            Oct 29 at 16:54

















          up vote
          2
          down vote













          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.






          share|improve this answer
















          • 8




            Why 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 6 '11 at 2:57

















          up vote
          0
          down vote













          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






          share|improve this answer



























            up vote
            -3
            down vote













            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.






            share|improve this answer
















            • 6




              The question was about WinForms, not ASP.NET.
              – Qwertie
              May 27 '14 at 22:38










            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f1322451%2fwhat-is-the-difference-between-user-control-custom-control-and-component%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            5 Answers
            5






            active

            oldest

            votes








            5 Answers
            5






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            140
            down vote



            accepted










            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).





            share|improve this answer


















            • 11




              Yeah, 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 5: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 5:59







            • 1




              @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
              – John Odom
              Jun 1 '15 at 22:46














            up vote
            140
            down vote



            accepted










            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).





            share|improve this answer


















            • 11




              Yeah, 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 5: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 5:59







            • 1




              @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
              – John Odom
              Jun 1 '15 at 22:46












            up vote
            140
            down vote



            accepted







            up vote
            140
            down vote



            accepted






            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).





            share|improve this answer














            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).






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 24 '09 at 16:03

























            answered Aug 24 '09 at 13:41









            Fredrik Mörk

            131k23246313




            131k23246313







            • 11




              Yeah, 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 5: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 5:59







            • 1




              @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
              – John Odom
              Jun 1 '15 at 22:46












            • 11




              Yeah, 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 5: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 5:59







            • 1




              @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
              – John Odom
              Jun 1 '15 at 22:46







            11




            11




            Yeah, 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




            Yeah, 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 5:31




            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 5: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 5:59





            @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 5:59





            1




            1




            @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
            – John Odom
            Jun 1 '15 at 22:46




            @FredrikMörk Nice answer! could you possibly suggest a site on where we could learn how to create custom controls?
            – John Odom
            Jun 1 '15 at 22:46












            up vote
            4
            down vote













            This is some difference between a CustomControl and a UserControl :



            Custom Control



            A loosely coupled control w.r.t code and UI



            Derives from Control



            Defines UI in a ResourceDictionary



            UI is skinable



            Has dynamic layout



            UI can be changed in different projects



            Has full toolbox support



            Defines a single control



            More flexible



            ==============



            User Control



            A tightly coupled control w.r.t code and UI



            Derives from UserControl



            Defines UI as normal XAML



            Child controls are skinable



            Has static layout



            UI is fixed and can't have different looks in different project



            Can't be added to the toolbox



            Defines a set of controls



            Not very flexible like a Custom Control






            share|improve this answer




















            • I don't agree with : Can't be added to the toolbox
              – Jagoda Sokół
              Jul 12 '17 at 9:29






            • 2




              At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
              – user3265613
              May 31 at 13:16










            • This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
              – Sebastian Negraszus
              Oct 29 at 16:54














            up vote
            4
            down vote













            This is some difference between a CustomControl and a UserControl :



            Custom Control



            A loosely coupled control w.r.t code and UI



            Derives from Control



            Defines UI in a ResourceDictionary



            UI is skinable



            Has dynamic layout



            UI can be changed in different projects



            Has full toolbox support



            Defines a single control



            More flexible



            ==============



            User Control



            A tightly coupled control w.r.t code and UI



            Derives from UserControl



            Defines UI as normal XAML



            Child controls are skinable



            Has static layout



            UI is fixed and can't have different looks in different project



            Can't be added to the toolbox



            Defines a set of controls



            Not very flexible like a Custom Control






            share|improve this answer




















            • I don't agree with : Can't be added to the toolbox
              – Jagoda Sokół
              Jul 12 '17 at 9:29






            • 2




              At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
              – user3265613
              May 31 at 13:16










            • This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
              – Sebastian Negraszus
              Oct 29 at 16:54












            up vote
            4
            down vote










            up vote
            4
            down vote









            This is some difference between a CustomControl and a UserControl :



            Custom Control



            A loosely coupled control w.r.t code and UI



            Derives from Control



            Defines UI in a ResourceDictionary



            UI is skinable



            Has dynamic layout



            UI can be changed in different projects



            Has full toolbox support



            Defines a single control



            More flexible



            ==============



            User Control



            A tightly coupled control w.r.t code and UI



            Derives from UserControl



            Defines UI as normal XAML



            Child controls are skinable



            Has static layout



            UI is fixed and can't have different looks in different project



            Can't be added to the toolbox



            Defines a set of controls



            Not very flexible like a Custom Control






            share|improve this answer












            This is some difference between a CustomControl and a UserControl :



            Custom Control



            A loosely coupled control w.r.t code and UI



            Derives from Control



            Defines UI in a ResourceDictionary



            UI is skinable



            Has dynamic layout



            UI can be changed in different projects



            Has full toolbox support



            Defines a single control



            More flexible



            ==============



            User Control



            A tightly coupled control w.r.t code and UI



            Derives from UserControl



            Defines UI as normal XAML



            Child controls are skinable



            Has static layout



            UI is fixed and can't have different looks in different project



            Can't be added to the toolbox



            Defines a set of controls



            Not very flexible like a Custom Control







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 8 '13 at 15:02









            Menard Laval

            15322




            15322











            • I don't agree with : Can't be added to the toolbox
              – Jagoda Sokół
              Jul 12 '17 at 9:29






            • 2




              At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
              – user3265613
              May 31 at 13:16










            • This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
              – Sebastian Negraszus
              Oct 29 at 16:54
















            • I don't agree with : Can't be added to the toolbox
              – Jagoda Sokół
              Jul 12 '17 at 9:29






            • 2




              At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
              – user3265613
              May 31 at 13:16










            • This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
              – Sebastian Negraszus
              Oct 29 at 16:54















            I don't agree with : Can't be added to the toolbox
            – Jagoda Sokół
            Jul 12 '17 at 9:29




            I don't agree with : Can't be added to the toolbox
            – Jagoda Sokół
            Jul 12 '17 at 9:29




            2




            2




            At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
            – user3265613
            May 31 at 13:16




            At least link to the artile you took your answer from. codeproject.com/Articles/179442/…
            – user3265613
            May 31 at 13:16












            This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
            – Sebastian Negraszus
            Oct 29 at 16:54




            This answer was copied from an article about Silverlight. Not only is it a copyright violation, but some of the content is wrong in the context of this question (which is about WinForms, not Silverlight).
            – Sebastian Negraszus
            Oct 29 at 16:54










            up vote
            2
            down vote













            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.






            share|improve this answer
















            • 8




              Why 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 6 '11 at 2:57














            up vote
            2
            down vote













            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.






            share|improve this answer
















            • 8




              Why 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 6 '11 at 2:57












            up vote
            2
            down vote










            up vote
            2
            down vote









            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 24 '09 at 16:08









            Chad Yeates

            1,17411727




            1,17411727







            • 8




              Why 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 6 '11 at 2:57












            • 8




              Why 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 6 '11 at 2:57







            8




            8




            Why 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 6 '11 at 2:57




            Why 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 6 '11 at 2:57










            up vote
            0
            down vote













            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






            share|improve this answer
























              up vote
              0
              down vote













              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






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                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






                share|improve this answer












                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







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 13 '17 at 23:36









                Robopro

                13




                13




















                    up vote
                    -3
                    down vote













                    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.






                    share|improve this answer
















                    • 6




                      The question was about WinForms, not ASP.NET.
                      – Qwertie
                      May 27 '14 at 22:38














                    up vote
                    -3
                    down vote













                    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.






                    share|improve this answer
















                    • 6




                      The question was about WinForms, not ASP.NET.
                      – Qwertie
                      May 27 '14 at 22:38












                    up vote
                    -3
                    down vote










                    up vote
                    -3
                    down vote









                    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.






                    share|improve this answer












                    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.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 20 '14 at 12:44









                    Himanshu Namdeo

                    284




                    284







                    • 6




                      The question was about WinForms, not ASP.NET.
                      – Qwertie
                      May 27 '14 at 22:38












                    • 6




                      The question was about WinForms, not ASP.NET.
                      – Qwertie
                      May 27 '14 at 22:38







                    6




                    6




                    The question was about WinForms, not ASP.NET.
                    – Qwertie
                    May 27 '14 at 22:38




                    The question was about WinForms, not ASP.NET.
                    – Qwertie
                    May 27 '14 at 22:38

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f1322451%2fwhat-is-the-difference-between-user-control-custom-control-and-component%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    How to read a connectionString WITH PROVIDER in .NET Core?

                    In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

                    Museum of Modern and Contemporary Art of Trento and Rovereto