J
Jeff
I have an abstract class which uses System.Windows.Forms.UserControl as it's
base class. It has some custom drawing methods and it also handles a few
common events like Paint, PaintBackGround, etc.
When I create a new UserControl I specify my abstract class as its base
class and it works beautifully. However, I would also like to create a new
Form and specify my abstract class as its base class so I can use the same
custom drawing methods and have it automatically handle the Paint events for
the form as well. The problem is I can't because the abstract class uses
UserControl as its base class and not Form.
I believe in C++ I would have used multiple inheritance (both the form class
and my abstract class), however, in C# that's not possible.
My first thought was to use an interface but from what I understand
interface members can not have defintions so I would have to recode the
custom drawing methods in each control that used the interface (messy).
What is the best way to do this?
base class. It has some custom drawing methods and it also handles a few
common events like Paint, PaintBackGround, etc.
When I create a new UserControl I specify my abstract class as its base
class and it works beautifully. However, I would also like to create a new
Form and specify my abstract class as its base class so I can use the same
custom drawing methods and have it automatically handle the Paint events for
the form as well. The problem is I can't because the abstract class uses
UserControl as its base class and not Form.
I believe in C++ I would have used multiple inheritance (both the form class
and my abstract class), however, in C# that's not possible.
My first thought was to use an interface but from what I understand
interface members can not have defintions so I would have to recode the
custom drawing methods in each control that used the interface (messy).
What is the best way to do this?