I have a UserControl in my Asp.net project that has a public property. I do not want this property to appear in the Visual Studio properties window when a user selects a UserControl instance in the IDE. What attribute (or other method) to use to prevent its occurrence?
class MyControl : System.Web.UI.UserControl { // Attribute to prevent property from showing in VS Property Window? public bool SampleProperty { get; set; } // other stuff }
Use the following attribute ...
using System.ComponentModel; [Browsable(false)] public bool SampleProperty { get; set; }
At VB.net this will be :
<System.ComponentModel.Browsable(False)>
Tons of attributes to control how the PropertyGrid works.
[Browsable(false)] public bool HiddenProperty {get;set;}
Use the System.ComponentModel.Browsable attribute to
> ' VB > > <System.ComponentModel.Browsable(False)>
or
// C# [System.ComponentModel.Browsable(false)]