search this site the web
Showing posts with label capital letters. Show all posts
Showing posts with label capital letters. Show all posts

Tuesday, March 16, 2010

Upper Case Letters in Text Box in vb.net

Private Sub ValidateNameTextBox(ByRef TB As TextBox)

If Not TB.Text = String.Empty Then
TB.Text = TB.Text.Substring(0, 1).ToUpper() & TB.Text.Substring(1, TB.Text.Length - 1).ToUpper()
TB.SelectionStart = TB.Text.Length
End If
End Sub


Private Sub Textbox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Textbox1.TextChanged
ValidateNameTextBox(Me.Textbox1)
End Sub