且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WinForm中提示Circular base class dependency involving 'TestEncryption.Form' and 'TestEncryption.Form'

更新时间:2022-08-15 15:08:57

        最近想做一个可以选择文件、加密方式进行加密的小东西,于是画了一个WinForm界面,但当我把Form的name由Form1改为Form时,提示如下错误:"Circular base class dependency involving 'TestEncryption.Form' and 'TestEncryption.Form'"

        错误的原因就是:The inheritance list for a class includes a direct or indirect reference to itself. A class cannot inherit from itself.即类不能循环继承。

因为修改Form的name后,会出现下面这段代码:

WinForm中提示Circular base class dependency involving 'TestEncryption.Form' and 'TestEncryption.Form'