I think what you're writing is not a Virtual Keyboard at all.
If you assume that a target focused item is a
TextBox
, it means that you write some control to assist typing for your application only. My advice is: either rename you component or implement a real Virtual Keyboard.
To do this, you need just to things:
1) Use P/Invoke for Windows API
SendInput
.
2) Resolve the problem of keyboard focus and preventing both hiding and activation of you Virtual Keyboard, see this:
Application focus getting and losing[
^].
If you make this real thing, it will simulate normal user input, and your backspace problem will be solved simply by simulation of backspace key press. Mind you, backspace is not the only one, so better use the real technique instead of
TextBox
manipulations.
—SA