In Visual Studio, when working on Windows Forms applications, a specific option can be found in the Design Design view. I am talking about an option GenerateMember(in the section of Designthe properties window).
The description of this parameter is as follows:
Indicates whether a member variable will be created for this component.
So, if I create a text box using the Dessigner form in my form , and I set this option to , then I cannot access the control inside the code (neither , nor ). tb1 f1false f1.tb1 tb1
There must be a good reason for this, but I don’t know what this reason is, why I ask:
- What is the meaning of the
Design> option GenerateMember? - What can be achieved by setting this option to false, which cannot be achieved with it to true?
- In what situations should I prefer to hide the control parameter
GenerateMemberinstead of false, instead of letting it have a default value (true)?
Thanks.
source
share