Page 1 of 1

Scroll to a line in a field

Posted: Tue Nov 16, 2010 8:12 pm
by Preston Shea
How does one scroll down to a specific line in a field?

Re: Scroll to a line in a field

Posted: Tue Nov 16, 2010 9:01 pm
by Dixie
Preston...

If you want to scroll to line 20... in a scrolling list field...

Code: Select all

on mouseUp
   set the vScroll of fld 1 to (20 * the effective textHeight of fld 1)
   set the hilitedLine of fld 1 to 20
end mouseUp
be well

Dixie

Re: Scroll to a line in a field

Posted: Tue Nov 16, 2010 10:54 pm
by dunbarx
Dixie's script is just fine. He even hilites the target line.

Just note that the field does not have to be a scrolling field. Any field can be "scrolled", in the sense that lines below the visible extent of the field can be brought into view in the same manner.

Craig Newman