When do we need to use [Browsable(true)]?
EDIT (by SLaks): He’s asking (I assume) why one would need to pass true as the parameter, given that it’s already true by default.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
MSDN says it all:
For example, if you’re creating a User Control, you might want to decorate non-UI-related properties with
[Browsable(false)]so that they will not be available through a “Properties” window.Additionally, it controls which properties of an object can be seen in a
PropertyGrid.As for why we can pass
trueexplicitly, I believe this is due toBrowsableAttributesproperty of aPropertyGrid. You can set it to containBrowsableAttribute.No, so that the property grid will display all non-browsable members.