|
Registering to a control event through designer and then removing registration in code while designer is still open should not cause Visual Studio problems
Scenario (by Palli): 1. Create a new Form 2. Add one Button control to it 3. Save the Form and close it 4. Reopen the Form 5. Select the Button, and via designer PropertyGrid/events, double click the Click event to add handler for click 6. The code window opens in a new tab 7. Click the design tab to see that you still have your properties (or events) for the button 8. Click the code tab, and delete the Click hander code 9. Go back to designer.
Problems: All properties in the designer PropertyGrid are gone. The list in the ComboBox above the designer PropertyGrid is still filled with the controls on the Form. Selecting a control from that ComboBox causes MS Visual Studio to crash.
Workaround suggestion: Have all Form designer windows closed when making changes to event handlers in code. Also, when you notice that the PropertiesWindow does not show the properties of the selected item, but a white space, save and close the designer window immediately and do not continue to work with it. Once closed, you can reopen it and continue to work as if nothing had happened.
See reproducing post:
http://www.visualwebgui.com/Forums/tabid/364/forumid/27/threadid/1914/scope/posts/Default.aspx
|