Hi for all and many thanks for attention, for now i'm studing the "inheritance" of a class. I have one class "Form1" and another class it have the inherit of the first "Form2:Form1" until this point all is ok, but i not need of all of Form1 members but only someone. it's possible inherit only someone of class member?

Recommended Answers

All 2 Replies

No, it's not possible. You can always ignore the members you don't want to use

This kind of situation is usually dealt with design pattern called delegation, but maybe better way is to isolate common functionality to separate class and inherit from it to both classes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.