protected override void Dispose(bool disposing)
在上面的一行中,我收到了错误。
错误是:
windowformapplication.form1.Dispose(bool): not suitable method found to override
答案 0 :(得分:3)
1)您可能已将class Form
重命名为class Form1
,但未将您的设计师档案重命名为Partial class Form.designer.cs
至Partial class Form1.designer.cs
2)您的InitializeComponent();会在你的windowformapplication.form1()构造函数中删除或注释。
或尝试在designer.cs中添加以下代码。
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
答案 1 :(得分:1)
确保您的Form1.cs从Form扩展。例如公共部分类Form1:表单{..}