Link to home
Start Free TrialLog in
Avatar of tentavarious
tentavarious

asked on

Virtual touch screen keyboard,I need help with backspace vb.net

Hello experts,  I created a simple virtual keyboard,  that sends the button text to a textbox.  For example if the A button is pressed, "A" will show up in the textfield.  And if Enter is pressed I send vbcrlf.  I am having trouble with the backspace button,  how do I clear one character in the textfield when backspace is checked?

  Sub filltext(ByVal charval As String)
        Me.txtmessage.Text += charval
    End Sub


    Private Sub btnz_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnz.Click
        filltext(btnz.Text) 'sends a z to the txtmessage
    End Sub

    Private Sub bntenter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntenter.Click
        filltext(vbCrLf) 'sends a line break
    End Sub

 Private Sub bntback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntback.Click
'What do I put here to clear out one character in the textfield
    End Sub
Avatar of AlexFM
AlexFM

Me.txtmessage.Text = Me.txtmessage.Text.Substring(0, Me.txtmessage.Text.Length - 1)
ASKER CERTIFIED SOLUTION
Avatar of jrscherer
jrscherer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tentavarious

ASKER

Thanks, thats what I was looking for.