Coding a TextBox Leaving The Backspace And Spacebar Working

Edwin_11 0 Tallied Votes 774 Views Share

I would Like to Use this code after you have clicked into your textbox
And I am Edwin Have a good Time

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        Select Case Asc(e.KeyChar)
            Case 8, 32, 65 To 90, 97 To 122
                e.Handled = False
            Case Else
                e.Handled = True
                MsgBox("Please Input Letters Only!!!!!")
        End Select
    End Sub
Reverend Jim 4,968 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A regular textbox by default allows backspace and space bar. What exactly are you trying to accomplish?

rproffitt 2,662 "Nothing to see here." Moderator

New members seem to misunderstand what "Code Snippet Repository" is for. It's for you to share working snippets. Not this.

Dani 4,329 The Queen of DaniWeb Administrator Featured Poster Premium Member

I think, in this case, he is meaning to supply a working code snippet for people to use if they have a text box in which they don’t want the space bar or escape key to work. I think his snippet description had a language barrier.

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.