我有几个具有类似功能的user controls
,因此我考虑将所有这些方法移至BaseUserControl class
,并使所有user controls
继承自它。
然而,当我这样做时,我得到了这个compliler警告:
Base class BaseUserControl specified for class UserControl1 cannot be different from the base class System.Windows.Forms.UserControl of one of its other partial types
我知道我收到此警告是因为当我创建BaseUserControl
时,其设计器中的自动生成代码会向System.Windows.Forms.UserControl
添加继承。
所以,
1. how can I inherit from an `UserControl` in `VB.NET`?
2.Is it possible? If not, how could I avoid code repetition in my case?
谢谢!