Imports System.Windows.Forms
Imports System.Drawing

Public Class EmailTextBox
    Inherits TextBox

    Private gbc, bbc As Color

    Public Property GoodBackColor() As Color
        Get
            Return gbc
        End Get
        Set(ByVal Value As Color)
            gbc = Value
        End Set
    End Property

    Public Property BadBackColor() As Color
        Get
            Return bbc
        End Get
        Set(ByVal Value As Color)
            bbc = Value
        End Set
    End Property


    Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)

        MyBase.OnTextChanged(e)

        If (Me.Text.IndexOf("@") <> -1 And Me.Text.IndexOf(".") <> -1) Then
            Me.BackColor = gbc
        Else
            Me.BackColor = bbc
        End If

    End Sub

    public overrides Sub GetType() as Type


End Class
