scroll a text field up/down with buttons

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

scroll a text field up/down with buttons

Post by sms5138 » Tue Sep 29, 2015 7:01 pm

Hi everyone,

I'm trying to create a button that will scroll/move a normal text field up/down using buttons instead of a scroll bar on the side...

I've tried the following code... thinking i'm on the right track, but no luck so far...

Code: Select all

on mouseUp
   set the thumbPosition of field "read" to 1
end mouseUp
and

Code: Select all

on mouseUp
   set the thumbPosition of scrollbar 1 to 1
end mouseUp
which seem to work great on a data grid that is present, but i can't seem to get it to figure out how to manipulate the text field.... I thought i'd see if anyone had any suggestions on a good way to do this...

Thank you in advance for any assistance you can provide!

-Sean

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: scroll a text field up/down with buttons

Post by Klaus » Tue Sep 29, 2015 7:07 pm

Hi Sean,

you want to set the SCROLL (or VSCROLL) of your field (in pixel):
...
set the scroll of fld 1 to 100
...
"thumbpos" is in fact a scrollbar property, but not of the scrollbar of a field!


Best

Klaus

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: scroll a text field up/down with buttons

Post by sms5138 » Tue Sep 29, 2015 7:34 pm

perfect!

Thanks so much Klaus!

-Sean

Post Reply