adding a design time designerto a specific property

A

Angel

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...
 
J

John Saunders

Angel said:
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))>
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top