Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   adding a design time designerto a specific property (http://www.velocityreviews.com/forums/t757111-adding-a-design-time-designerto-a-specific-property.html)

Angel 09-28-2004 08:41 PM

adding a design time designerto a specific property
 
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...

John Saunders 09-28-2004 09:54 PM

Re: adding a design time designerto a specific property
 
"Angel" <Angel@discussions.microsoft.com> wrote in message
news:E77CA71E-7668-47BE-8D01-5B1270ADAB73@microsoft.com...
>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),typ eof(System.Drawing.Design.UITypeEditor))>
-----
John Saunders





All times are GMT. The time now is 02:23 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.