Believe me it is a question.
Hi,
I am a VB Beginner as you might have understood from the title. I wanted to make a fashionable Login Form with the Textboxs that follow these:
The default text in the UserNameTB would be "UserName Goes Here" in a Gray Color.
When the User clicks the UserNameTB the text would changes to "" and the color to Black.
Please study these code to get other conditons:
Private Sub UserName_TB_GotFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserName_TB.GotFocus
If UserName_TB.Text = "UserName" Then
UserName_TB.Text = ""
UserName_TB.ForeColor = Color.Black
End If
End Sub
Private Sub UserName_TB_LostFocus(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UserName_TB.LostFocus
If UserName_TB.Text = "" Then
UserName_TB.Text = "UserName"
UserName_TB.ForeColor = Color.Gray
End If
End Sub
This works fine with a Simple TextBox But when I set the property 'UseSystemPasswordChar' to True (for the password) there is an exception.
You may write an article on this topic as I didn't found any.
Thank You.