Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted (edited)

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:

 

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

Edited by stratisphere
Added code tags - 2nd: Dam Typos
Posted

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 :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...