Page 1 of 1

Buttons position according to scrollbar position

Posted: Thu Sep 17, 2015 11:04 am
by shalu
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

Re: Buttons position according to scrollbar position

Posted: Thu Sep 17, 2015 1:24 pm
by Klaus
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

Re: Buttons position according to scrollbar position

Posted: Thu Sep 17, 2015 1:48 pm
by dunbarx
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