PDA

Click to See Complete Forum and Search --> : scroling the other way


spike232
Nov 18th, 2002, 03:28 PM
how do u make a text box (with scrolbar) work like a log dispaly window.

eg
the new event/messages are added at the bottom, but when the area gets full and the scrollabar becomes active the scrollbar stays at the bottom,so u can always see the newest messages/events unless u scroll up urself ???

PT Exorcist
Nov 18th, 2002, 05:06 PM
textbox1.selectionstart = 0;

or

textbox1.selectionstart = textbox1.text.length;

spike232
Nov 19th, 2002, 11:24 AM
thanks, but that only works when u click in the txt box, and if u click out of it it stops scrolling down, is there another way??

hellswraith
Nov 19th, 2002, 12:19 PM
Everytime you add something to the text box, add the line
textbox1.selectionstart = textbox1.text.length;
right after it.

spike232
Nov 19th, 2002, 12:39 PM
thats what i have done,
for testing this, i have a textbox and a timer on a form
on the timer event it adds a line to the text box
then sets that right after it

when the form first loads it u leave it it fills the text box then when it fills up the scroll bar stays at the top while it files up, now if u clic on it it jumps to the bottom, if u click out of it, it will stay where it last was

:confused:

PT Exorcist
Nov 20th, 2002, 12:41 PM
u must focus the textbox!

spike232
Nov 20th, 2002, 01:22 PM
is there anyway to do it that will allow u to use other controls on the form withoguht affecting it?? eg not having to give it focus all the time??

kovan
Nov 22nd, 2002, 03:17 PM
u can dig into api's.. SendMessage api