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. not inheriting control from base class

not inheriting control from base class

Scheduled Pinned Locked Moved C#
question
4 Posts 4 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.
  • F Offline
    F Offline
    falles01
    wrote on last edited by
    #1

    Can anyone tell me how I can have a control tht I don't want other classes to inherit? I have a base class and the child class needs to inherit but I don't want it to inherit one of the comboboxes. I need to delete it. I tried to go into the designer class and declare protected but it still inherits. Thank you Sianny aka Sharny

    V R 2 Replies Last reply
    0
    • F falles01

      Can anyone tell me how I can have a control tht I don't want other classes to inherit? I have a base class and the child class needs to inherit but I don't want it to inherit one of the comboboxes. I need to delete it. I tried to go into the designer class and declare protected but it still inherits. Thank you Sianny aka Sharny

      V Offline
      V Offline
      vikas maan
      wrote on last edited by
      #2

      Hi, Make it as a sealed class. :)

      1 Reply Last reply
      0
      • F falles01

        Can anyone tell me how I can have a control tht I don't want other classes to inherit? I have a base class and the child class needs to inherit but I don't want it to inherit one of the comboboxes. I need to delete it. I tried to go into the designer class and declare protected but it still inherits. Thank you Sianny aka Sharny

        R Offline
        R Offline
        rohitsrivastava
        wrote on last edited by
        #3

        i suppose use non abstract class but not sure

        P 1 Reply Last reply
        0
        • R rohitsrivastava

          i suppose use non abstract class but not sure

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          No. A non abstract class is just a class that can be instantiated. The answer to this is to make the class sealed so that it cannot be inherited from.

          public sealed class CannotBeInherited
          {
          }
          

          Deja View - the feeling that you've seen this post before.

          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