I am doing a project that allows user to customized the properties of a Control
. I have a form that has a control like Label
, TextBox
,
Please note this is only useful for Hiding properties (when you can). Reza Aghaei answer is actually the correct answer.
I'll leave this here as it's suitable for the other case when you just simply want to hide a property when you have access to it.
Original
Easiest way is probably to use
[Browsable(false)]
BrowsableAttribute Class
Specifies whether a property or event should be displayed in a Properties window.
[Browsable(false)]
public int SecretSquirrels
{
get; set;
}
Also as pointed out by Marc Gravell, there is also
PropertyGrid.BrowsableAttributes Property
Gets or sets the browsable attributes associated with the object that the property grid is attached to.