I'm making a keyboard on visual basic and i want to know how do a backspace in the simplest way?
Thanks.
Printable View
I'm making a keyboard on visual basic and i want to know how do a backspace in the simplest way?
Thanks.
Are you talking about an on-screen keyboard? For only within your application or "system-wide"?
Yea a virtual keyboard to use within the program.
Chr(8) is the backspace.
How would i go about using it if the output was a textbox?Quote:
Originally Posted by RobDog888
Heres a complete example.
Code:Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = "Blah,..."
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Focus()
TextBox1.SelectionStart = TextBox1.Text.Length
SendKeys.Send("{BACKSPACE}")
End Sub
End Class
Thanks it worked but i dont really understand all thsi focus stuff im quite new to vb.
Is there any easier way to do it? basically just removing the last character inputted?
Thanks
Yes, its all still simple. The focus is needed because sendkeys send the key to the current active windo for input. So to insure the textbox is focused for input se set focus to it.
You can do similar with the keypress/keydown events and manipulations but is more code.