View previous topic :: View next topic |
Author |
Message |
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Fri Sep 21, 2007 1:07 pm Post subject: Scrolling to the bottom of a text box |
|
|
Greetings!
Just like the scrolling to the bottom of the listview with this code Code: |
if(lv.items.length)
lv.ensureVisible(lv.items.length - 1);
|
is there such a function for a textbox? I tried txtNotes.scrollToCaret(), but it probably is not what I want.
Any help would be greatly appreciated.
thanks
jic |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Sat Sep 22, 2007 1:41 pm Post subject: Re: Scrolling to the bottom of a text box |
|
|
What I do is set the selection to the last character or the last line (the last character can be undesired if word wrapping is off). You will also want to ensure the hideSelection = false.
Some keywords for setting the selection are: selectionStart, selectionLength, select.
It is demonstrated in the DFL-IRC code. |
|
Back to top |
|
|
jicman
Joined: 22 Dec 2004 Posts: 298 Location: Rochester, NY
|
Posted: Sun Sep 23, 2007 11:11 pm Post subject: |
|
|
I did get it to work with your suggestion, but this one works better:
Code: | txtNotes.focus();
txtNotes.appendText(" ");
|
So, this one works for me.
thanks.
jic |
|
Back to top |
|
|
|