15

One thing I hate about WinForms:

"do not modify the contents of this method with the code editor."

How the phook do I add eventhandlers without adding them in the code? By some mysterious ways in the so called "designer"? Click and drag? Wearing a tie and talking to the computer? Making a phone call to Microsoft? Immersing into VR and ordering an event handler from a virtual store?

No, I've always just typed whatever I want to achieve and I'm going to do so whatever those know-it-all comments say in the auto-generated code.

You can call me a conservative old fart, but nothing beats writing my own code.

Comments
  • 3
    If they really wanted to keep us away from the code, they wouldn't expose it towards us, think about it..
  • 2
  • 2
    Actually yeah. Double click the event you want and a method is created for you.
  • 2
    Every designer File is declared as partial. One File is generated by VS and one File is for you, which you can add your Eventhandler...
    Ps: As already posted, you can also add Eventhandlers in the Property Window
  • 1
    Adding an eventhandler is not the problem (as others said: double-click), but removing it is

    You can also just add it inside of the ctor
  • 1
    @MAGNUMpt Typing the eventhandler is way faster than finding it among a zillion properties. No, coding-by-clicking is just not my cup of tea.
Add Comment