|
-
July 18th, 2005, 10:01 PM
#1
Converting characters to upper-case...
Code:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) _
Handles TextBox1.KeyPress
' replace the selected text with an uppercase character. (Inserts at caret position
' if no text is selected.)
If TextBox1.Text.Length < TextBox1.MaxLength Then
TextBox1.SelectedText = e.KeyChar.ToString.ToUpper
End If
' cancel standard processing.
e.Handled = True
End Sub
Ok, here's the problem. What I'm trying to do is have a small text box that will accept characters and automatically turn them into capital letters. However, when I try to erase characters using the back-space key, that doesn't work at all. What seems to be the problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|