I’d like to programatically scroll it to the end of the field so the user can see XYZ at the end of the text and continue typing. This seems like such a basic thing, but I’m stumped. Seems like .HorizontalScrollPosition is made for this but I can’t seem to get it to work.
Any hints would be appreciated. Thanks in advance.
Strange. I’ve tested it using Xojo 2024r1 on Windows 10.
Below the TextField i’ve placed a Slider and in it’s ValueChanged Event i use:
Var seletedLength As Integer = TextField1.SelectionLength
TextField1.SelectionStart = Me.Value
TextField1.SelectionLength = seletedLength
TextField1.SetFocus
I think it works as you’d expect it.
As you can see, i did not even use the HorizontalScroll Position. But i set the Focus to the TextField, so that the user can see the Cursor.
Thank you. I have a valid License for Einhugur, but i try to avoid Plugins wherever possible. And the Einhugur SearchControl has it’s own flaws (regarding Focus f.e.). But in general it’s a really nice Control.
One quick note, removing .SetFocus fixes the cursor position issue on MacOS because .SetFocus automatically selects all on the textfield. But it still does not scroll the horizontal position of the textfield the way it does on Windows.
If anyone can think of a workaround to horizontally scroll in the textfield for MacOS, I’m all ears.
Appreciate the link. This is my first go at MacOSLib and I’ve spent the last hour trying to do the most basic of things and I can’t even get the example project to run without a hard crash on startup. Will keep at it but I fear there’s more to learn here than I have time for. Even so, I appreciate you giving me a direction to head towards. Cheers!