+ Post New Thread
Results 1 to 3 of 3
Coding Thread, C# Clarification in Coding and Web Development; So i've been programming for years, C# for several and never came across the need todo this. Now I do ...
  1. #1
    stratisphere's Avatar
    Join Date
    Apr 2007
    Posts
    295
    Thank Post
    33
    Thanked 87 Times in 31 Posts
    Rep Power
    31

    C# Clarification

    So i've been programming for years, C# for several and never came across the need todo this. Now I do and I cant think how the hell to do it, let alone what it's called (so I cant google how to to it).

    Ok, so I have 2 classes. One is inherited from a UserControl, and the other is inherited from that:

    Code:
    public class ParentPanel : UserControl {
      public ParentPanel() { InitializeComponent(); }
      public void DoClearup() { 
        // stuff here etc
      }
    }
    public class DisplayReg : ParentPanel {
    
    }
    Ok, what i want (which i'm sure i've seen elsewhere) is for DisplayReg to have to impliment DoCleanup().

    Anyone know how to do this? Or know of the term used to describe it?

    Cheers
    Last edited by stratisphere; 24th September 2008 at 10:46 AM. Reason: Added code tags - 2nd: Dam Typos

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,867
    Thank Post
    412
    Thanked 778 Times in 651 Posts
    Rep Power
    182
    Declare it abstract, don't you? or maybe virtual, I don't remember. However, abstract will mean that you can't create any instances of the base class, so caution.

  3. Thanks to powdarrmonkey from:

    stratisphere (24th September 2008)

  4. #3
    stratisphere's Avatar
    Join Date
    Apr 2007
    Posts
    295
    Thank Post
    33
    Thanked 87 Times in 31 Posts
    Rep Power
    31
    Thats the one, needed to declare the method abstract. Cheers buddy.

    I dont need to create any instances, just simply need to inherit from it to make the code a little cleaner and more effecient



SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 17
    Last Post: 25th October 2007, 09:03 AM
  2. VLAN Clarification Required
    By ICTNUT in forum Wireless Networks
    Replies: 26
    Last Post: 28th June 2007, 02:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •