Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Differences Control vs UserControl

Differences Control vs UserControl

Scheduled Pinned Locked Moved C#
visual-studiodesignquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ivan Fernandez
    wrote on last edited by
    #1

    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 1 Reply Last reply
    0
    • I Ivan Fernandez

      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 Offline
      A Offline
      Alex Korchemniy
      wrote on last edited by
      #2

      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

      C 1 Reply Last reply
      0
      • A 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

        C Offline
        C Offline
        cchere
        wrote on last edited by
        #3

        For a composite control, couldn't I just use a panel as a container?

        A 1 Reply Last reply
        0
        • C cchere

          For a composite control, couldn't I just use a panel as a container?

          A Offline
          A Offline
          Alex Korchemniy
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups