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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Inheriting a class or implementing a interface...

Inheriting a class or implementing a interface...

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

    Hi, I have a public partial class "con_param_tou : UserControl" (standard userControl) But i want to inherit or implement a interface of a class that i build. So i want to maintain the designer mode of standard User Control but i also want to implement or inherit one of my classes. My class is currently declared as public interface base_param_interface (because I know that i cannot inherit multiple classes... So what I want to do is inherit UserControl and implement one of my interfaces which has a couple of public properties and 2,3 functions... How do I do that? Thanks in advance!

    V 1 Reply Last reply
    0
    • B Benny_Lava

      Hi, I have a public partial class "con_param_tou : UserControl" (standard userControl) But i want to inherit or implement a interface of a class that i build. So i want to maintain the designer mode of standard User Control but i also want to implement or inherit one of my classes. My class is currently declared as public interface base_param_interface (because I know that i cannot inherit multiple classes... So what I want to do is inherit UserControl and implement one of my interfaces which has a couple of public properties and 2,3 functions... How do I do that? Thanks in advance!

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      Just change your class definition to read

      class YourClass : SomeBaseClass, ISomeInterface
      {
      // stuff goes here
      }

      Cheers, Vıkram.


      I don't suffer from insanity, I enjoy every moment of it.

      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