How to hide property @ Runtime
-
Is there any better way to hide property runtime other than [BrowsableAttribute(false)] ? There is only PreFilterProperties for Design mode but I couldn`t find anything like this for runtime, anyone can help me out?
Hello, I think I do not understand the question. :confused:
Vertyg0 wrote:
hide property runtime other than [BrowsableAttribute(false)]
I allways thought, that the BrowsableAttribute effects design time. If you do not whant to have an effect by changing a property during runtime, maybe you can use a if(DesignMode) //is a Member of System.ComponentModel.Component { } in your set accessor of the property. Hope that helps you. All the best, Martin
-
Hello, I think I do not understand the question. :confused:
Vertyg0 wrote:
hide property runtime other than [BrowsableAttribute(false)]
I allways thought, that the BrowsableAttribute effects design time. If you do not whant to have an effect by changing a property during runtime, maybe you can use a if(DesignMode) //is a Member of System.ComponentModel.Component { } in your set accessor of the property. Hope that helps you. All the best, Martin
-
I want to hide property. For instance i want to hide Text property so that it doesnt show up in PropertyGrid at runtime.
At runtime, there is no direct way to hide a property. But you could use some methods presented in some of the articles here on CodeProject to manage the set of displayed properties. For example, the PropertyBag can allow you to choose what properties are displayed at runtime. More generally speaking, if you have a class derived from ICustomTypeDescriptor that publishes a set of PropertyDescriptors, you can choose to temporarily remove one of the properties. Hope that helps.
Best regards, Nicolas Cadilhac Smart PropertyGrid.Net @ VisualHint Microsoft PropertyGrid Resource List Free PropertyGrid for MFC
-
At runtime, there is no direct way to hide a property. But you could use some methods presented in some of the articles here on CodeProject to manage the set of displayed properties. For example, the PropertyBag can allow you to choose what properties are displayed at runtime. More generally speaking, if you have a class derived from ICustomTypeDescriptor that publishes a set of PropertyDescriptors, you can choose to temporarily remove one of the properties. Hope that helps.
Best regards, Nicolas Cadilhac Smart PropertyGrid.Net @ VisualHint Microsoft PropertyGrid Resource List Free PropertyGrid for MFC