c# - 找不到合适的方法来覆盖

标签 c#

如何解决这个问题? 错误 1

'WindowsApplication2.Form4.Dispose(bool)': no suitable method found to override C:\Users\%USER%\Documents\Visual Studio 2013\Projects\WindowsFormsApplication3\WindowsFormsApplication3\Form4.Designer.cs 14 33 WindowsFormsApplication3

protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

最佳答案

您是否重命名了 Form4.cs 文件中的表单?

检查这两个文件中的类名。它们应该是这样的:

Form4.cs

namespace WindowsFormApplication3
{
    public partial class Form4 : Form

Form4.designer.cs

namespace WindowsFormApplication3
{
    partial class Form4

关于c# - 找不到合适的方法来覆盖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28838242/

相关文章:

c# - 处理 ASP.NET 空 Web 应用程序上的所有请求

c# - 将 GridView 选定项设置为无

c# - 由于 CLR.dll Windows 应用程序崩溃 - Windows 2008 R2 Server

c# - 如何实现可暂停的 BlockingCollection

c# - 为什么串口接收到的数据为空?

c# - 在我停止我的 libusbdotnet 应用程序后,USB 设备保持连接和断开连接

c# - 如果解析不好,则解析 JSON 语法

c# - 多个文本框 WPF 的一个功能

c# - 在 Visual Studio 2010 中为 RavenDB 配置/安装 log4net

c# - 如何将桌面应用程序与网页连接?