dispose(bool):找不到合适的方法来覆盖 [英] dispose (bool): no suitable method found to override

查看:300
本文介绍了dispose(bool):找不到合适的方法来覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力编译,但我一直收到错误

'PTZ_Camera_Motion_Control01.Form1.Dispose(bool)':找不到合适的方法来覆盖

我是一直在网上搜索答案并尝试过但错误仍然存​​在。

我正在使用.NET Framework 4.代码如下。我真的很感激我能得到的任何帮助。谢谢。





/////Form1.cs///////

I keep trying to compile but I keep getting the error
'PTZ_Camera_Motion_Control01.Form1.Dispose(bool)':no suitable method found to override
I've been searching for answers on the web and tried them but the error still resides.
I'm using .NET Framework 4. The code is below. I'll really appreciate any help I can get on this. Thank you.


/////Form1.cs///////

namespace PTZ_Camera_Motion_Control01
{
    public partial class Form1 : Form 
    { 
        public Form1()
        {
            InitializeComponent();
        }
    }
}





///////Form1.Designer.cs ///////



///////Form1.Designer.cs///////

namespace PTZ_Camera_Motion_Control01
{
    partial class Form1
    {
        private System.ComponentModel.IContainer components = null;

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

推荐答案

对不起,我不知道,问题是否已经存在解决了。如果是这样,请忽略我。



对我而言,你试图覆盖void Dispose(bool)来执行某些动作。

这是没有安排的,因为Designer-Code已经覆盖了它。



通常的方法是订阅Form.Disposed-Event,以执行一些操作当表格被处理时。
sorry, i don't know, whether the problem is already solved. if so, ignore me.

To me it seems, you try to override void Dispose(bool), to perform some action.
That is not scheduled, since the Designer-Code already did override it.

A usual approach is to subscribe the Form.Disposed-Event, to perform some action in the moment, when the form gets disposed.


这篇关于dispose(bool):找不到合适的方法来覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆