相关疑难解决方法(0)

Winforms - 可视化删除按钮单击事件

.NET新手提醒

使用Visual C#2008 Express Edition我不小心为按钮创建了一个单击事件.然后我删除了自动创建的方法代码,这导致了一个错误,表示现在已经在表单加载代码中引用的函数无法再找到.

Form1.Designer.cs文件的InitializeComponent()功能中删除以下行...

this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click);
Run Code Online (Sandbox Code Playgroud)

...似乎可以做到这一点,但是,由于#region开头的以下警告,它让我觉得非常脏:

/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
Run Code Online (Sandbox Code Playgroud)

我无法使用表单设计器找到一种方法来执行此操作,我认为这是此警告隐含的方法.这样做的正确方法是什么?

c# events visual-studio-express winforms

16
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

events ×1

visual-studio-express ×1

winforms ×1