Hide property at runtime.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ray Cassick

    #1

    Hide property 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.

    Hmmmm

    --
    Me
    Anywhere USA


  • Matt F

    #2
    Re: Hide property at runtime.

    I do remember that it's an attribute ---

    pretty sure it's <Browsable(Fals e)>

    "Ray Cassick" <rcassickNO-SPAM@enterproci ty.comwrote in message
    news:Oq0v$htNHH A.3916@TK2MSFTN GP02.phx.gbl...
    >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
    >
    --
    Me
    Anywhere USA
    >

    Comment

    • Ray Cassick

      #3
      Re: Hide property at runtime.

      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" <mfielderREMOVE CAPS@nospam.nos pamwrote in message
      news:upszVltNHH A.4848@TK2MSFTN GP04.phx.gbl...
      >I do remember that it's an attribute ---
      >
      pretty sure it's <Browsable(Fals e)>
      >
      "Ray Cassick" <rcassickNO-SPAM@enterproci ty.comwrote in message
      news:Oq0v$htNHH A.3916@TK2MSFTN GP02.phx.gbl...
      >>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
      >>
      >--
      >Me
      >Anywhere USA
      >>
      >
      >

      Comment

      Working...