将一个表单的类继承到另一个表单类

avi*_*hse 3 vb.net visual-studio-2010

我有两个窗体form1.vbform2.vb.我的代码到目前为止:

'form1.vb
class form1
    function print(byval i as integer) as boolean
End class

'form2.vb
class form2
    inherits form1
end class
Run Code Online (Sandbox Code Playgroud)

代码无法编译,它显示以下错误:Error 1 Base class 'form1' specified for class 'form2' cannot be different from the base class.

有没有办法继承从一种形式一类到另一个类的另一种形式的,因为我书面方式,我不常用的一些功能要每重写哪里?

请指导我正确的方向.

Viv*_* S. 6

转到 > Form2.Designer.vb并改变

Inherits System.Windows.Forms.Form
Run Code Online (Sandbox Code Playgroud)


Inherits WindowsApplication1.Form1Inherits Form1