Buttons position according to scrollbar position

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
shalu
Posts: 72
Joined: Fri Mar 20, 2015 1:05 pm

Buttons position according to scrollbar position

Post by shalu » Thu Sep 17, 2015 11:04 am

Hi,

I am beginner in LiveCode, I am looking for the code for when I change thumbPosition of the scrollbar, then the button's position automatically charged to a new position is it possible :cry:

Thanks
Shalu
--
Thanks
Shalu S

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

Re: Buttons position according to scrollbar position

Post by Klaus » Thu Sep 17, 2015 1:24 pm

Hi Shalu,

yes this is possible, use the "scrollbardrag" message of the scrollbar
and use the paramter that message come with:

Code: Select all

on scrollbardrag tValue
   set the loc of btn 1 to tValue,tValue
end scrollbardrag
Best

Klaus

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

Re: Buttons position according to scrollbar position

Post by dunbarx » Thu Sep 17, 2015 1:48 pm

Hi.

What Klaus meant. :wink:

You will have to scale "tValue" according to your needs of course. Right out of the box, that value will likely place the button well off screen.

Craig Newman

Post Reply