How can I get Browsable (false) to actually hide a property in the IDE

Good afternoon,

I created a custom component with a boolean property. I would like Visual Studio not to show it in the properties window. I use googled extensively, and the consensus seems to be trying to use the Browsable / BrowsableAttribute property descriptors.

Visual Studio seems to ignore this attribute altogether. I tried to build all my projects, dropping the toolbox to no avail. Please, help.

Thanks and greetings, -Alan.

[Browsable(false)] // I have also tried [BrowsableAttribute(false)] public bool IsBusy { get { return _isBusy; } set { throw new InvalidOperationException(""); } } 
+4
source share
1 answer

It really is [Viewable]. Omitting the setter will be another way, which makes sense in this scenario.

I assume that you have a real problem - this is an old copy of this control stored in the toolbox build folder. Such a copy is created if you add the control to the toolbar yourself using the "Select Items", "Browse" items. You may be updating your local copy, but not the toolbar version.

I need to wave my arms a little, I know that this can happen, but it was not discovered how this happens. This never went wrong for me personally, but I always make sure that the toolbar automatically fills itself, and does not add the control explicitly. If you added it like this, then start by deleting it. Right-click an item in the toolbar and select Delete. A copy is stored in c: \ users \ yourname \ appdata \ local \ microsoft \ visualstudio \ xx \ projectassemblies

+6
source

Source: https://habr.com/ru/post/1340077/


All Articles