Click here to Skip to main content
15,893,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Problem of inheritance of form class. I want to understand the level of abstraction that is needed by a form class.


Thanks you.

What I have tried:

Dealing with class form in C#, I have heard that it's better to not create a class that inherits from another form class you created.

But I have a form "Human". This form has some usefull panels and I don't want to recreate that.

Is it better to create these panels somewhere else (as CustomControl) than to create a class inherited from my own form "Human" ?
Posted
Updated 26-Oct-17 2:45am

Inheritance is (a form of) code re-using. If such code re-using is a clear advantage in your scenario then go on with it.
 
Share this answer
 
Comments
Karthik_Mahalingam 26-Oct-17 21:29pm    
5Simple and clear
If you create a Form (for example) which you will later use as a Template (that means that you have common methods and/or common controls and/or common behaviour) then this will be a good example for such Inheritance.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900