加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 如果删除了winform元素的函数调用,如何修复?

发布时间:2020-12-16 01:52:13 所属栏目:百科 来源:网络整理
导读:我正在.Net C#中构建应用程序. 我不小心双击了我的应用程序中的文本框,并且创建了一个textbox_click函数,我删除了该函数,因为我不需要它,但是当我运行我的应用程序时,有一个: Error 1 'Bond_Yield_Calculator.BaseForm' does not contain a definition for
我正在.Net C#中构建应用程序.
我不小心双击了我的应用程序中的文本框,并且创建了一个textbox_click函数,我删除了该函数,因为我不需要它,但是当我运行我的应用程序时,有一个:

Error   1   'Bond_Yield_Calculator.BaseForm' does not contain a definition for 'textBox5_TextChanged' and no extension method 'textBox5_TextChanged' accepting a first argument of type 'Bond_Yield_Calculator.BaseForm' could be found (are you missing a using directive or an assembly reference?)   C:UsersAlex Chandocumentsvisual studio 2010ProjectsBond Yield CalculatorBond Yield CalculatorBaseForm.Designer.cs   139 77  Bond Yield Calculator

错误,我该如何解决这个问题?

解决方法

双击错误,它会将您跳转到代码中的该位置.删除创建事件处理程序的代码行.

如果这是winforms,它将看起来像

Bond_Yield_Calculator.BaseForm.TextBoxChanged += new EventHandler(textBox5_TextChanged);

它可能在一个名为的文件中

xxxxx.designer.cs (Where xxxxxx is the name of a form or control in your project.)

或者,如果它是ASP.NET,您将在标记内部看到类似的内容

OnTextChanged=”textBox5_TextChanged”

删除它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读