Microsoft Visual Studio.NET editor automatically generates code for each and every control which you drag and drop on a WinForm. But we mostly don’t refer to the code of certain controls like labels, panels, group boxes.
It is possible to get rid of auto-generated code for such controls by setting the property GenerateMemberCode value to false.
For example if you have a label control in a WinForm which you don’t refer in the code and you prefer to remove the cluttered code of that label then follow these steps
- Select the label control displayed in the WinForm designer
- Open properties window
- Set GenerateMember property value to false