views:

50

answers:

1

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 ?

A: 

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.

Pedro
Actually I have been bitten by this myself, it will remove the code but leave the function.
Scott Chamberlain
Just to clarify, the method is not removed, just the content.Am I the only one getting that behavior from the IDE ?
Guillaume G.