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. Replacement for multiple inheritance

Replacement for multiple inheritance

Scheduled Pinned Locked Moved C#
questioncsharpoop
2 Posts 2 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.
  • S Offline
    S Offline
    Severino
    wrote on last edited by
    #1

    Hello, I'm developing a set of Windows form controls that should extend the functionalities of the following classes: public class MyPushButton : System.Windows.Forms.Button public class MyCheckbox : System.Windows.Forms.CheckBox public class MyRadioButton : System.Windows.Forms.RadioButton I decided to derive a class from each of these base classes in order to get the right notifications from the base class events. Now these custom controls should apply some graphic effect to the buttons through a set of properties that would be common to all of the "MyXXX" button classes: due to the fact that multiple inheritance is not supported in C#, how can I avoid to have all of the properties and their get/set helpers duplicated in each of the "MyXXX" classes? Thanks in advance and Kind regards Seve

    C 1 Reply Last reply
    0
    • S Severino

      Hello, I'm developing a set of Windows form controls that should extend the functionalities of the following classes: public class MyPushButton : System.Windows.Forms.Button public class MyCheckbox : System.Windows.Forms.CheckBox public class MyRadioButton : System.Windows.Forms.RadioButton I decided to derive a class from each of these base classes in order to get the right notifications from the base class events. Now these custom controls should apply some graphic effect to the buttons through a set of properties that would be common to all of the "MyXXX" button classes: due to the fact that multiple inheritance is not supported in C#, how can I avoid to have all of the properties and their get/set helpers duplicated in each of the "MyXXX" classes? Thanks in advance and Kind regards Seve

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      What you need to be looking at, for controls at least, is Property Extenders: MSDN: Windows Forms Extender Provider Sample[^] MSDN: Implementing an Extender Provider[^] CodeProject: Control Extender Library[^] This should hopefully give you enough information to get you underway. --Colin Mackay--

      EuroCPian Spring 2004 Get Together[^]

      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