<p>I have a UserControl in my Asp.net project that has a public property. I do not want this property to show up in the Visual Studio Property Window when a user highlights an instance of the UserControl in the IDE. What attribute (or other method) should I use to prevent it from showing up?</p>

<pre><code>class MyControl : System.Web.UI.UserControl {
  // Attribute to prevent property from showing in VS Property Window?
  public bool SampleProperty { get; set; }

  // other stuff
}
</code></pre>

[{'answer_id': 71454, 'author': 'Phil Wright', 'author_id': 6276, 'author_profile': 'https://Stackoverflow.com/users/6276', 'pm_score': 5, 'selected': True, 'text': '<p>Use the following attribute ...</p>\n\n<pre><code>using System.ComponentModel;\n\n[Browsable(false)]\npublic bool SampleProperty { get; set; }\n</code></pre>\n\n<p>In VB.net, this <a href="https://stackoverflow.com/questions/71440/set-a-usercontrol-property-to-not-show-up-in-vs-properties-window#71481">will be</a>:</p>\n\n<pre><code>&lt;System.ComponentModel.Browsable(False)&gt;\n</code></pre>\n'}, {'answer_id': 71459, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p><a href="http://www.c-sharpcorner.com/UploadFile/mgold/PropertyGridInCSharp11302005004139AM/PropertyGridInCSharp.aspx" rel="nofollow noreferrer">Tons of attributes</a> out there to control how the PropertyGrid works.</p>\n\n<pre><code>[Browsable(false)]\npublic bool HiddenProperty {get;set;}\n</code></pre>\n'}, {'answer_id': 71481, 'author': 'Codeslayer', 'author_id': 4021, 'author_profile': 'https://Stackoverflow.com/users/4021', 'pm_score': 2, 'selected': False, 'text': "<p>Use the <code>System.ComponentModel.Browsable</code> attribute to</p>\n\n<pre><code>&gt; ' VB\n&gt; \n&gt;     &lt;System.ComponentModel.Browsable(False)&gt;\n</code></pre>\n\n<p>or</p>\n\n<pre><code>// C#\n    [System.ComponentModel.Browsable(false)]\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/71440', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/51/']