Design-Time Attributes of Custom Controls
page 5 of 6
by . .
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 28749/ 26

Revising the control
Revising the Control

Below is the updated control (not all of it because the missing part was exactly the same).

<DefaultProperty("Text")> _
Public
Class VSHighlight
Inherits
System.Web.UI.WebControls.WebControl
Implements
IPostBackEventHandler

Private pvText As String
Private
tColor As System.Drawing.Color = System.Drawing.Color.Black
Private
bgColoroff As System.Drawing.Color = System.Drawing.Color.White
Private
bgColoron As System.Drawing.Color = System.Drawing.Color.LimeGreen

<TypeConverter(GetType(System.Drawing.ColorConverter)), _
Category("Appearance"), _
Description("Sets the color of the text.")> _
Public
Property TextColor() As System.Drawing.Color

Get

Return
tColor

End
Get
Set
(ByVal Value As System.Drawing.Color)
tColor = Value

End
Set
End
Property

<TypeConverter(GetType(System.Drawing.ColorConverter)), _
Category("Appearance"), _
Description("Sets the background color of the table when clicked.")> _

Public
Property BackColor_On() As System.Drawing.Color
Get

Return
bgColoron

End
Get
Set
(ByVal Value As System.Drawing.Color)
bgColoron = Value

End
Set
End
Property

<Category("Misc"), _
Description("Specifies the text to be displayed."), _
DefaultValue("Sample Text"), _
Browsable(True)> _

Public
Property Text() As
String
Get

Return
pvText

End
Get
Set
(ByVal Value As String)
pvText = Value

End
Set
End
Property

Pretty easy right?


View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-18 5:28:16 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search