0

guyz, I want to know on how to convert small letter to capital letters. I want to convert every letter automatically once I press the keyboard. Hope you help me this guyz.. Im going to wait for your replies..

3
Contributors
7
Replies
12
Views
6 Years
Discussion Span
Last Post by Lee21
0

guyz, I want to know on how to convert small letter to capital letters. I want to convert every letter automatically once I press the keyboard. Hope you help me this guyz.. Im going to wait for your replies..

Dim s As String = "SOME STRING"
s = s.ToUpper ' Converts String To Upper Case
s = s.ToLower ' Converts String To Lower Case
0
Dim s As String = "SOME STRING"
s = s.ToUpper ' Converts String To Upper Case
s = s.ToLower ' Converts String To Lower Case

just additional comment
u can put it in the KeyPress method so every time u press a key it will be automatically converted

0
Dim s As String

        s = txtLname.Text
        s = s.ToUpper
        txtLname.Text = s

I already tried what you advised but I want that everytime I press the keys on the keyboard even though it is not in capslock the output is it is on capital letters, the output is displayed in the textbox

0
Dim s As String

        s = txtLname.Text
        s = s.ToUpper
        txtLname.Text = s

I already tried what you advised but I want that everytime I press the keys on the keyboard even though it is not in capslock the output is it is on capital letters, the output is displayed in the textbox

Add the following code to your textbox keypress event

Private Sub TxtSearchItems_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtSearchItems.KeyPress
        e.KeyChar = e.KeyChar.ToString.ToUpper
    End Sub

Edited by y2_sub: correction

0
Private Sub txtLname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtLname.KeyPress
txtLname.CharacterCasing = CharacterCasing.Upper

I found a script like this but the first time you press the keyboard nothing happens the output only happens on the second time you press the keyboard. I want it to happen by the time once I press the keyboard. Is there anything missing or lacking? please help me guyz...

0
Private Sub txtLname_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtLname.KeyPress
txtLname.CharacterCasing = CharacterCasing.Upper

I found a script like this but the first time you press the keyboard nothing happens the output only happens on the second time you press the keyboard. I want it to happen by the time once I press the keyboard. Is there anything missing or lacking? please help me guyz...

You can change the character casing property from the property window in designer mode so that the text entered will always be in uppercase ( even on the first keypress)

0

thanx a lot guyz for your help... Thanx for sharing your knowledge!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.