Constituent Controls and Design Time

Discussion in 'ASP .Net Building Controls' started by Jim-M, Jun 27, 2004.

  1. Jim-M

    Jim-M Guest

    I'm inheriting TextBox in my custom control...it has a property that is
    type TextBox and will point to two other TextBox controls on the form.

    This is working correctly, however at design time, the Property Browser
    displays a "+" sign when the property is set to a control other than
    (none). This toggles the detail of the TextBox that the property value
    points to.

    Is there an attribute I can apply to the property declaration that will
    control whether this little plus-minus detail is available at design
    time in the Property Browser? It would be inappropriate in my case to
    be able to modify the underlying properties of the control pointed to by
    the property, as this control is
    always available at design time.

    I've declared the property as such:

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Visible
    )> _
    Public Property StateTextBox() As TextBox
    Get
    Return _StateTextBox
    End Get
    Set(ByVal Value As TextBox)
    _StateTextBox = Value
    End Set
    End Property
    Private _StateTextBox As TextBox
    Jim-M, Jun 27, 2004
    #1
    1. Advertising

  2. Jim-M

    Jim-M Guest

    Sorry, that should have read "will point to *another* TextBox"...

    "Jim-M" <> wrote in message
    news:...
    > I'm inheriting TextBox in my custom control...it has a property that

    is
    > type TextBox and will point to two other TextBox controls on the form.
    >
    > This is working correctly, however at design time, the Property

    Browser
    > displays a "+" sign when the property is set to a control other than
    > (none). This toggles the detail of the TextBox that the property

    value
    > points to.
    >
    > Is there an attribute I can apply to the property declaration that

    will
    > control whether this little plus-minus detail is available at design
    > time in the Property Browser? It would be inappropriate in my case to
    > be able to modify the underlying properties of the control pointed to

    by
    > the property, as this control is
    > always available at design time.
    >
    > I've declared the property as such:
    >
    >

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Visible
    > )> _
    > Public Property StateTextBox() As TextBox
    > Get
    > Return _StateTextBox
    > End Get
    > Set(ByVal Value As TextBox)
    > _StateTextBox = Value
    > End Set
    > End Property
    > Private _StateTextBox As TextBox
    >
    >
    >
    Jim-M, Jun 27, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dwok
    Replies:
    2
    Views:
    398
  2. Reckoner
    Replies:
    17
    Views:
    490
    John O'Hagan
    Feb 9, 2009
  3. dwok
    Replies:
    2
    Views:
    129
  4. dwok
    Replies:
    2
    Views:
    118
  5. Alex Maghen

    Passing "Style" along to constituent controls

    Alex Maghen, May 30, 2006, in forum: ASP .Net Web Controls
    Replies:
    9
    Views:
    221
    Walter Wang [MSFT]
    Jun 1, 2006
Loading...

Share This Page