Link to home
Start Free TrialLog in
Avatar of rainbowsoftware
rainbowsoftware

asked on

ScrollBar.Position

I want to place the ScrollBar.Position in an Edit.Text.
It is simple the get the ScrollBar.Position, but the positioning is increasing from top to bottom and I want to show numbers decreasing from top to bottom.
I don't want to use a SpinEdit or similar, it must be a scrollBar or similar component.
How can I do it?
Avatar of Matvey
Matvey

You have a scrollbar, you have the OnChange even, you have the Position propery, you have the Max, Min or whatever... Can you explain the problem better? I think I don't get the problem...
Avatar of rainbowsoftware

ASKER

OK, I'll try to explain, what I want to do in another way.
With the ScrollBar as Vertical.
When the Button is scrolled to the top of the ScrollBar or TrackBar I want the position value to be 0 (zero) and when the button is scrolled to the bottom, I want the position value to be 100.
Sorry, now I'm confusing myself.
When in top it must show 100 and when on the bottom 0 (zero).

Value := 100 - ScrollBar1.Position

Doesn't this work??

There must be more to it if you ask, right???
Hello Matvey! Haven't heard of you for years.... What's up??

Hello all of ya ;->

I think the Max property is better as you mentioned before...

Edit1.text := IntToStr(ScrollBar.Max - ScrollBar.Position);

Hope this helps :-)

Cheers,
Viktor
yeah, just place the code viktor said in the OnChanrge event of the TrackBar.

bryan

I believe there is a OnScroll() of the TScrollBar so you better place the code I gave you in the OnScroll() of the TScrollBar you got ;->

Cheers,
Viktor
viktor,  what's the difference between OnChange and OnScroll ?

bryan

I don't know but to be exact... when you need to change something when something is scrolled then use the OnScroll() event if there is one.,,,

Cheers,
Viktor
OK, EKIM then TrackBar and ScrollBar both starts with 0 on top, so it's not the solution.
VIKTORNET gave the right answer to my question.
Thanks a lot.
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial