Can't set focus on text area set by index

Hey guys. Long time…

So I have a Desktop text area set and,= neither textarea(anyNumber).SetFocus or textarea(anyNumber).SelectionStart = (some other number) will put the cursor in the textarea at that index. It always goes to textarea(1) regardless. In fact, the only way I can find to remove the cursor from that field is to set it as read only.

Anyone have any tips on how to force the focus/SelectionStart to where I want it to go?

Thank you.

I just tried in a blank project and it works fine. There’s something else interfering in your project.

You can test yourself:
In a blank project, put 5 TextAreas as an array, a slider going from 0 to 4 and a push button with this code:

And notice it works out of the box.

Thanks Arnaud. I know that should work - and it’s exactly what I’ve been trying but to no avail, There was something weird going on with it. That text area set also kept changing font colour randomly. I’ve deleted it and started again and now it works.

When something is corrupted, it can indeed be hard to find workarounds. Your choice of recreating the set was certainly the best.

1 Like

In the end I had to recreate the whole page. Son of a motherless goat!