title: How should I name form controls variables and their event handlers in WinForms?
body: <p>I have a little coding style problem - what names should I choose for controls in Windows Forms in my application? I think that best approach is to not generate the field at all (<code>GenerateMember</code> property), this can work at buttons, separators, menu items etc.</p>
  
  <p>But there are for example some labels and controls that I need to reference, modify, disable, etc. from the code. Currently I name them this way: <code>lblInfo</code> (label) , <code>cbPerson</code> (combobox), btnOK - I think this is useful use of Hungarian notation. Their names start in lowercase because they are form's fields. </p>
  
  <p>I choose names for the menu items depending on their hierarchy - so it's menuFileExit, menuEditCopy, etc.</p>
  
  <p>The problem comes when I create event handler for one of controls - Visual Studio autogenerates handler such as: </p>
  
  <p><code>btnOk_Click</code>, <code>menuEditCopy_Click</code> - and <em>StyleCop and I</em> don't like no methods that start with lowercase. I also wouldn't like the event handlers to have different prefix than the name of the control that raises the event. Should I just name the event handlers like <code>BtnOk_Click</code> with first letter in uppercase to satisfy the coding standard? Thanks</p>