我有两个窗体窗口form1.vb
和form2.vb
。到目前为止,我的代码:
'form1.vb
class form1
function print(byval i as integer) as boolean
End class
'form2.vb
class form2
inherits form1
end class
该代码无法编译,并显示以下错误:Error 1 Base class 'form1' specified for class 'form2' cannot be different from the base class
。
当我编写一些我不想在任何地方重写的通用函数时,有什么方法可以将一个类从一种形式继承到另一种形式的另一种?
请指引我正确的方向。
转到>Form2.Designer.vb
并更改
Inherits System.Windows.Forms.Form
到
Inherits WindowsApplication1.Form1
或Inherits Form1
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句