Hide a property from a property grid at runtime.



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.

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.



--
Me
Anywhere USA


.



Relevant Pages

  • Re: usercontrol with readonly property that can be set at design time
    ... Ultimately I'm trying to find out which label was clicked and show the ... I don't want to do any sort of case statement based on the control ... because as the name suggests the values for such a property are design time ... are use at design time only. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Custum Control basic question
    ... in CF1 you have to build 2 assemblies for your custom control. ... for design time and the other for runtime. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Using classes not derived from control at design time?
    ... Maybe you want to create your own design surface (like a custom drawn design ... bot it's still a Control that is derived and implements a ... to set this properties at design time. ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: NotSupportedException for PictureBox image in CF 2.0
    ... picture box control at design time? ... When I associate an image with a PictureBox control at design ... PictureBox control with no image associated. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Design time and complex properties
    ... I am designing a control, and one of the properties of this control is an ... I want for developers to be able to modify the control's properties at ... MyControl.Appearance.GradientAngle at design time, the control should ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)