Hide property at runtime.

R

Ray Cassick

I am looking for a way to hide a property I created on a user control from a
property grid at runtime but allow it to be seen at design time.

Any ideas?

I tried setting the category of the property to 'Design' and that does not
do it.

I tried adding the 'DesignOnly' attribute and that does not do it.

I am about to break out Reflector and have a peek myself to see if I can
find it from the libraries themselves because as best I can tell the
Usercontrol base class does it for the Name, GenerateMember, Locked, and
Modifiers properties. I just want to tack my property in there.

Hmmmm
 
R

Ray Cassick

That hides it always from the property Grid. I only want the property to be
hidden when you look at the properties of the control at runtime.

Here is some background. I am designing a control that is going to be
manipulated at BOTH runtime (on a custom design surface) and at design time.
I need a few properties seen in the property grid ONLY at design time and
not when the controls properties are seen in a property grid at runtime.

Its a bit confusing I know but I have seen this be done right before my very
eyes. All the standard Usercontrol properties in the Design category act
this way.


Matt F said:
I do remember that it's an attribute ---

pretty sure it's <Browsable(False)>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top