adding a design time designerto a specific property

Discussion in 'ASP .Net Building Controls' started by Angel, Sep 28, 2004.

  1. Angel

    Angel Guest

    I added an image property to my custom control. the property type i set at as
    string because I want the url that is to be used for the control. How do I
    set for this image property when the developer is in the properties window
    and clicks to enter this value for the property, the ability to view the Add
    URL generic window to seach for the url. Here is a sample of my code:

    <Category("Display"), DefaultValue("")> Public Property Image() As String
    Get
    If viewstate("Image") Is Nothing Then
    Return _strImage
    Else
    Return CType(viewstate("Image"), String)
    End If
    End Get
    Set(ByVal Value As String)
    _strImage = Value
    viewstate("Image") = _strImage
    End Set
    End Property

    The developer will see this property in the properties window of the
    control. I want the developer to be able to search for the url within the
    properties window. this same "Add URL" prompt window is present on the src
    property of an HTML Image control.

    thank you...
    Angel, Sep 28, 2004
    #1
    1. Advertising

  2. "Angel" <> wrote in message
    news:...
    >I added an image property to my custom control. the property type i set at
    >as
    > string because I want the url that is to be used for the control. How do I
    > set for this image property when the developer is in the properties window
    > and clicks to enter this value for the property, the ability to view the
    > Add
    > URL generic window to seach for the url. Here is a sample of my code:
    >
    > <Category("Display"), DefaultValue("")> Public Property Image() As
    > String
    > Get
    > If viewstate("Image") Is Nothing Then
    > Return _strImage
    > Else
    > Return CType(viewstate("Image"), String)
    > End If
    > End Get
    > Set(ByVal Value As String)
    > _strImage = Value
    > viewstate("Image") = _strImage
    > End Set
    > End Property
    >
    > The developer will see this property in the properties window of the
    > control. I want the developer to be able to search for the url within the
    > properties window. this same "Add URL" prompt window is present on the src
    > property of an HTML Image control.


    Add the EditorAttribute:

    <Editor(typeof(System.Web.UI.Design.UrlEditor),typeof(System.Drawing.Design.UITypeEditor))>
    -----
    John Saunders
    John Saunders, Sep 28, 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. Mark
    Replies:
    0
    Views:
    450
  2. Shimon Sim
    Replies:
    7
    Views:
    477
    Steven Cheng[MSFT]
    Aug 3, 2005
  3. Saimeera
    Replies:
    0
    Views:
    511
    Saimeera
    May 10, 2006
  4. flamesrock
    Replies:
    8
    Views:
    452
    Hendrik van Rooyen
    Nov 24, 2006
  5. Ryan Taylor

    using the Items property in the design time property window

    Ryan Taylor, Feb 8, 2005, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    538
    Paul Louth
    Feb 18, 2005
Loading...

Share This Page