Hi,
I’m building a window dynamically and placing a TextBox on a panel. This TextBox needs to be focussed immediately and the cursor needs to be at the start (SelectionStart = 0).
I’ve tried everything (well, I think I have) and I can’t get WiseJ to do this. I can load a TextBox, place it in the panel and set its TabIndex to 0 but whatever I do, can’t get the cursor flashing at the start, rather than at the end.
Help!
Thanks Alaa – I’ll watch out for it.
Hi Neil,
The fix with this issue is available with Wisej 2.5.26.
Best,
Alaa
That works Frank, thank you. I think I tried every combination of setting focus, selecting text and application.upate (plus others), except the combination above!
Actually the best way to achieve what you want is by using this:
txtBox.Focus(); txtBox.Call("setTextSelection", 0, 0);
Otherwise the focus cycle is asychnronous and the selection only works with the code I previously posted
to have the cycle finish before.
But this code above is the preferred solution.
Best regards
Frank
Hi Neil,
as a workaround you can use code like this:
txtBox.Focus(); Application.Update(this); txtBox.SelectionStart = 0; txtBox.SelectionLength = 0;
We are currently investigating this issue and get back to you.
Best regards
Frank
Please login first to submit.