Hi Thomas,
Thanks for your valuable inputs. I also tried using the GotFocus and LostFocus to 'register' as the active control, essentially the same way you did. It works like a charm for Character textboxes, but not for Numeric ones, as each time I click on a number keypad, it loses the numeric textbox focus which basically acts as if user already left.
What I did not do however is to store its Value first like what you did.
FYI, I was able to successfully do my virtual keyboard as a Toolbar; it cannot be done visually, it should be done programmatically.
Thanks!
>Hi Dennis,
>
>I#ll tell you how I did in with my POS-app:
>
>1 My Forms contain different containers which are suited to serve different tasks.
>There are two of these "panels" which are contaiining buttons as key-replacements,
>one is for numeric input only, the other is a basic keyboard-replacement.
>I add two pics to illustrate this.
>
>The buttons pass their values to a form -method which handles the simulated keystrokes:
>
>
>thisform.dokeyhandler(ASC(this.label1.Caption))
>
>
>You can also use the taf-property.
>
>3. The Textboxes use the Gotfocus and Lostfocus-props to tell the form which txtbox is active
>
>
>thisform.cactivefield = "txtanrede"
>IF thisform.cactivefield <> thisform.lastcontrol
> thisform.cValStore = ""
>Endif
>
>
>cValstore is used to control the input and later to assign the value to the txtbox
>
>
>thisform.lastcontrol = "txtanrede"
>
>
>Lostfocus saves the textbox which is left.
>
>
>4 All this is handled in a form-method which assigns the values to the receivers like
>in this excerpt.
>
>
>thisform.cValStore = thisform.cValstore + CHR(nKeycode)
>cCommand = "thisform." + thisform.cactivefield + ".value = '" + thisform.cValstore + "'"
>&cCommand
>cFeld = thisform.cactivefield
>nlength = LEN(ALLTRIM(thisform.&cFeld..value))
>thisform.&cFeld..ssTextBox1.SelStart = nLength
>
>
>So this is what I basically do, I hope this helps. Please excuse the typos, my eyesight is bad today.
>
>Best regards
>
>Thomas