A little known, as far as I can tell from asking around, yet extremely useful property in the Windows Forms designer’s property grid is
true, it decides whether a control/component gets declared as a field on the form (
true) or as a local variable in the
InitializeComponent method (
false). Setting it to
false helps you remove some of the ‘clutter’ from your form, like those labels you placed on it, that you know you’re never going to reference from your code. Now you don’t even have to give them meaningful names in case someone bumps into them.
Justin suggested it might have been a better idea to default this property to
false, but after considering this, I tend to disagree – I find that most of the controls I place on a form are referenced from my code and I’d rather have too many controls available than wondering where they’d gone.