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. Inheriting User Controls

Inheriting User Controls

Scheduled Pinned Locked Moved C#
winforms
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.
  • B Offline
    B Offline
    Brett Slaski
    wrote on last edited by
    #1

    Greetings, When I inherit from a user control I would like to rearange the controls of the base control on the new control. E.g. I have to list boxes side by side on the base control. I would like to change that to one list box above the other on the inherited control. The code for these controls are the same and I would like to get reuse out of this if possible. Thank you, Brett

    S 1 Reply Last reply
    0
    • B Brett Slaski

      Greetings, When I inherit from a user control I would like to rearange the controls of the base control on the new control. E.g. I have to list boxes side by side on the base control. I would like to change that to one list box above the other on the inherited control. The code for these controls are the same and I would like to get reuse out of this if possible. Thank you, Brett

      S Offline
      S Offline
      Syed Abdul Khader
      wrote on last edited by
      #2

      Make the list boxes in the base control as public and do then rearranging.

      B C 2 Replies Last reply
      0
      • S Syed Abdul Khader

        Make the list boxes in the base control as public and do then rearranging.

        B Offline
        B Offline
        Brett Slaski
        wrote on last edited by
        #3

        True enough, how simple. Protected is probably a much safer bet though.

        1 Reply Last reply
        0
        • S Syed Abdul Khader

          Make the list boxes in the base control as public and do then rearranging.

          C Offline
          C Offline
          Charlie Williams
          wrote on last edited by
          #4

          sssyed_in wrote: Make the list boxes in the base control as public and do then rearranging. I think protected would be more appropriate. Charlie if(!curlies){ return; }

          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