Cursor position in textbox

Dear Experts.
When I enter cursor in textox then it appears at the left side of data as shown in Emulator.

Then I have to move it to the beginning of the box to write digits
Is it possible on gotfocus the cursor must go to the left side of data.


Try this extension

Is there not any other solution without this Extension?

Start with a blank textbox (or show 0.00 as the hint)

You can use the gotFocus event and clear the field in it if the value in it is 0.


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.

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.

1 Like

Ingenious. It won't work without the clock?

1 Like

HI @Patryk_F,
thanks for your comment :grinning:.
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" ... :rofl: :rofl: :rofl:
Ciao, ciao !

1 Like

Should one remove all the previous \rs ?

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.

This sounds very retro, a reminder of the origins of CR and LF, moving the carriage of a print head and rolling a platen respectively.

1 Like

Sure, you are absolutely right. :+1:
In effect I'm 65, therefore it's perfect for my age .... :rofl: :rofl: :rofl:

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.

1 Like

Yep, thanks a lot @TIMAI2 for your tests !!!
:muscle: :muscle: :muscle: