Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / September 2004

Tip: Looking for answers? Try searching our database.

adding a design time designerto a specific property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angel - 28 Sep 2004 21:41 GMT
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 - 28 Sep 2004 22:54 GMT
>I added an image property to my custom control. the property type i set at
>as
[quoted text clipped - 23 lines]
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.