Way*_*rts 16 c# events visual-studio-express 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)
我无法使用表单设计器找到一种方法来执行此操作,我认为这是此警告隐含的方法.这样做的正确方法是什么?
Jas*_*yon 34
在designer.cs文件中工作时必须要小心,但是你不必为此感到肮脏(当我犯同样的错误时,更容易将它修复为designer.cs文件).你可以像这样在视觉上做到:
归档时间: |
|
查看次数: |
18641 次 |
最近记录: |