Tilting Code
Tilting Code

Reputation: 137

Hide unused control event

Using VS 2015 with WinForms I have double clicked on a control and brought up it's default Sub event. I'll never have to write code in this event but now it's there taking up space. I deleted it and when I double clicked on it again nothing happened. However, when I went back into my code I noticed it was indeed re-created.

Now, if I was to ever have to write code in this control I can no longer double click on it. I know I can right click and choose View Code but what I'm wondering is if I did something wrong. Should I just leave the unused event routine there and just collapse it (click on the -+), or is there a better, more efficient way to hide an unused control event?

Thanks...

Upvotes: 1

Views: 128

Answers (1)

KillAllYourSons
KillAllYourSons

Reputation: 71

If you go to the properties (F4) events tab, try Rick-clicking on the event you want removed, and selecting "Reset".

I think doing this should work:

enter image description here

Upvotes: 1

Related Questions