mIRC Home    About    Download    Register    News    Help

Print Thread
#220569 18/04/10 03:51 PM
Joined: Apr 2010
Posts: 964
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
Working on a @picwin listbox with scrollbar but having issues. How do I reverse this equation?(if it's correct at all)

F = First Item to display
T = Total items available for display(-25 to account for the current items displayed. Divided by the amount of pixels the thumb of the scrollbar can move)
S = Current Scrollbar Thumb Pos(-64 to account for the scrollbar not being at the top of the @picwin)

F = (T - 25) / 308 * (S - 64)
T = F / (S - 64) * 308 + 25
S = ?


Last edited by FroggieDaFrog; 18/04/10 03:55 PM.
Joined: Jun 2007
Posts: 930
5
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 930
Assuming the formula is F = ((T-25)/308)*(S-64) and not F = (T-25)/(308*(S-64))

T=(308*F/(S-64))+25
S=(308*F/(T-25))+64

:P

5618 #220571 18/04/10 04:03 PM
Joined: Apr 2010
Posts: 964
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 964
Yea, order of operations. Thank you smile


Link Copied to Clipboard