stratisphere Posted September 24, 2008 Posted September 24, 2008 (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 September 24, 2008 by stratisphere Added code tags - 2nd: Dam Typos
powdarrmonkey Posted September 24, 2008 Posted September 24, 2008 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. 1
stratisphere Posted September 24, 2008 Author Posted September 24, 2008 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now