Imports System.ComponentModel
Imports System.Web.UI

<DefaultProperty("Text"), ToolboxData("<{0}:AspFocusText runat=server></{0}:AspFocusText>")> Public Class AspFocusText
    Inherits System.Web.UI.WebControls.TextBox

    Private _onFocus As String = "this.style.backgroundColor = ""LightGreen"""
    Private _onBlur As String = "this.style.backgroundColor = ""white"""

    Public Property onFocus() As String
        Get
            Return _onFocus
        End Get
        Set(ByVal Value As String)
            _onFocus = Value
        End Set
    End Property
    Public Property onBlur() As String
        Get
            Return _onBlur
        End Get
        Set(ByVal Value As String)
            _onBlur = Value
        End Set
    End Property

    Protected Overrides Sub AddAttributesToRender(ByVal writer As System.Web.UI.HtmlTextWriter)
        writer.AddAttribute("onFocus", _onFocus)
        writer.AddAttribute("onBlur", _onBlur)
        MyBase.AddAttributesToRender(writer)
    End Sub

End Class
