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..

Recommended Answers

All 7 Replies

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
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

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

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
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...

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)

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.