Answers for "How to Create Hint, PlaceHolder Text, Watermark In a TextBox vb.net"

1

How to Create Hint, PlaceHolder Text, Watermark In a TextBox vb.net

Private Sub TextBox1_MouseEnter(Sender As Object, e As EventArgs) Handles TextBox1.MouseEnter
        If TextBox1.Text = "Enter your first name" Then
            TextBox1.Text = ""
            TextBox1.ForeColor = Color.Black
        End If
    End Sub
    Private Sub TextBox1_MouseLeave(sender As Object, e As EventArgs) Handles TextBox1.MouseLeave
        If TextBox1.Text = "" Then
            TextBox1.Text = "Enter your first name"
            TextBox1.ForeColor = Color.Gray
        End If
    End Sub
Posted by: Guest on June-05-2021

Code answers related to "How to Create Hint, PlaceHolder Text, Watermark In a TextBox vb.net"

Browse Popular Code Answers by Language