开发者

Problem with VS 2010 IDE when removing event handler using properties window

开发者 https://www.devze.com 2023-01-04 10:37 出处:网络
Here\'s the steps to reproduce the problem : Create a c# project with a form with 1 control, let\'s say a textbox.

Here's the steps to reproduce the problem :

  1. Create a c# project with a form with 1 control, let's say a textbox.
  2. Using the properties window (lightning bolt thingy), add a开发者_开发知识库 "click" event.
  3. Write some code in that method.
  4. Using the properties window, remove the content of the "click" event cell.

I would like to know why is the code from step 3 has disapear (but not the method signature).

Normal behavior from the IDE ? Option in the "tools-options" menu ?


The method you created should remain even after it has been unhooked from the control's event. The only time VisualStudio will automatically remove the method is if the method is empty. Once you add custom code, the method should not be removed.

0

精彩评论

暂无评论...
验证码 换一张
取 消