set VScrollTrack's position(solved)


22-12-2010 08:23:07

I meet a problem when I use WordWrap,as follows image"1.jpg".
The VScrollTrack's position is in the bottom of VScroll by default,when the textarea's height is longer than WordWrap's height.
This does not fit people's custom.
So I want to set VScrollTrack's position in the top of VScroll by default,as follows image"2.jpg".
Anybody can solve the problem?


22-12-2010 10:02:12

You can select part of text through code to force EditBox scroll there. Try
mEdit->setTextSelection(0, 0);
Edit: Actually you can use not tricky way:mEdit->setTextCursor(0);


23-12-2010 03:27:44

The second method is OK after I try above method.
But I want to comet true it in script.
I use as follows:

<Property key="CursorPosition" value="0 0"/>

The result is not OK.
So I want to know whether is there a method to use in script or not.


23-12-2010 09:44:02

Problem is once you add text cursor moves. So you should call setTextCursor(0) every time you add text.

P.S. There was typo in LE. CursorPosition is one integer, not two. I fixed that.


23-12-2010 11:44:53

Thanks for your reply!