How to temporarily disable Visual studio auto generated events?
Asked Answered
D

4

8

All,

I have finished the GUI design phase... Now I've started to add meaningful names to all the controls in my application. Visual Studio is driving me nuts auto generating the events each time I click on the control to change its name (ok so it only happens when I mess up and double click... but still annoying).

Is there a way to temporarily disable this feature? I still want it because it is a great short cut when I'm coding.

Thanks!

Diphtheria answered 2/10, 2009 at 20:39 Comment(0)
Z
10

You can't disable double clicking AFAIK but you can open document outline (Menu View > Other Windows > Document Outline), and rename the controls via F2 in this window. It'll be much faster and will help see easily the visual tree if your form is complex.

Zarathustra answered 2/10, 2009 at 21:50 Comment(1)
Great Tip!!! Still hate you can't disable that functionality but this is better anyway.Diphtheria
M
1

afaik there is not. Just be careful with your clicking and if you do mess up CTRL+Z CTRL+Z is your friend :)

Manufacture answered 2/10, 2009 at 20:43 Comment(1)
I don't understand why this answer was down voted. This functionality of VS 2015 is driving me crazy. I don't know why I haven't thought about simple CTRL+Z before. Just like you've said, it's you friend. Thanks for useful tip.Dramatization
O
1

If you can recognize which controls are which in code, you could open the .Designer.cs files and rename the controls there with the refactoring tool (right click the control name, Refactor, Rename).

It may or may not be straightforward to recognize which controls are which given that you have used generic names so far, but at least it's an option. Personally, I avoid that situation by immediately assigning meaningful names.

Oasis answered 2/10, 2009 at 20:45 Comment(0)
S
0

It's not just renaming controls, it's resizing them by dragging that is a bigger problem. CTRL+Z works to remove the auto-generated code but simultaneously undoes the resizing of the control. Very annoying.

Seedbed answered 25/2, 2021 at 18:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.