Dear @Tariq_Mehmood,
all the other solutions are pretty good, but I faced the same problem a few days ago and I solved it with a different approach:
When a Text box gets the focus, the only thing it does is to enable a clock, that some milliseconds after, reformats the text box by adding a Carriage Return character. In this way the text box maintains the previous text, and repositions the cursor on the leftmost character.
Like the following:
In this way whenever you tap on any character of a Text Box (that already contains text) after the clock period milliseconds, the cursor is repositioned on the left.
If 500 ms is too long tor you, you can (try to) reduce it.
Cheers.
PS I was using an external Bluetooth keyboard to enter the text, therefore I had also arrow keys and other useful ones. Please bear in mind that by repositioning the cursor on the left, while you don't have arrow keys, it could be uncomfortable.
HI @Patryk_F,
thanks for your comment .
No, unfortunately it was not working without clock. At the beginning I tried to manage directly into the GotFocus event, but (for some mysterious reason) the cursor, irrespective of the \r character, remained on the position where the finger was tapping the text. I've experienced many other times (for example with the Speech Recognizer) that "leaving the time" to AI2 to do the job, by means of a delay obtained with a clock, things have started to work fine.
In a nutshell: "...when you get lost, you'd better get a clock" ...
Ciao, ciao !
Hi @TIMAI2,
honestly I don't know, because I did it with a single line Text Box.
But probably it works anyway (without removing the other \rs, if any), because the "trick" is to add the Carriage Return as the last character of the Text Box text , done after a while, so to force a reformat of the text.
Works with multiple entries at the beginning of the text (without removing \rs) but you do get a build up of \rs at then end of the text, which present as spaces. These can be removed each time like so:
However the problem arises as to what to do with the \r if you want to type at the right end of the text and not the left, because doing the above will remove what appear to be spaces as well. I guess you could use the segment block to clear the end of the typed text, and replace any \rs in between words with spaces.....
This hack also appears to work with a multiline textbox.