ScrollBar -Set Slider position with script - Solved

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
DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

ScrollBar -Set Slider position with script - Solved

Post by DR White » Sat Aug 31, 2013 1:56 pm

How does one set the Slider position of a ScrollBar with script from a button?

I have tried the code below, but none work:

on mouseUp
set newValue of scrollbar "BooksScrollBar" to 2000
end mouseUp

also tried:

on mouseUp
set vscroll of scrollbar "BooksScrollBar" to 2000
end mouseUp

also tried:

on mouseUp
set field of scrollbar "BooksScrollBar" to 2000
end mouseUp

Definitely Need Help.

Thanks,

David
Last edited by DR White on Thu Sep 19, 2013 2:58 am, edited 1 time in total.

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: ScrollBar -Set Slider position with script

Post by andrewferguson » Sat Aug 31, 2013 2:30 pm

Hi,
The property you are looking for is the thumbPosition

Code: Select all

on mouseUp
set thumbPosition of scrollbar "BooksScrollBar" to 2000 
end mouseUp
Hope this helps,
Andrew

DR White
Posts: 718
Joined: Fri Aug 23, 2013 12:29 pm

Re: ScrollBar -Set Slider position with script

Post by DR White » Sat Aug 31, 2013 2:50 pm

Andrew,

WOW!!

That works GREAT! Problem Solved! :D

Where could have I looked to find it out myself?

Thank You VERY MUCH,

David

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

Re: ScrollBar -Set Slider position with script

Post by Klaus » Sat Aug 31, 2013 3:03 pm

Hi David,
Where could have I looked to find it out myself?
here: http://www.hyperactivesw.com/revscriptc ... ences.html
Maybe stack "Controls" 8)


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: ScrollBar -Set Slider position with script

Post by dunbarx » Sat Aug 31, 2013 3:18 pm

Sometimes a little detective work is required. If you had looked up "scrollbar" in the dictionary, you would have found a bunch of leads. And under the "object" type, which is the most pertinent if you think about it, you would have found an example using "thumbposition". You may not have immediately know what that meant, but that is how it is done.

Pay particular attention to the "see also" section of any dictionary entry. Those links are invaluable, and often lead to what you really need.

Craig Newman

Post Reply