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?
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?
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...
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.
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.
ASKER
Sorry, now I'm confusing myself.
When in top it must show 100 and when on the bottom 0 (zero).
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???
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
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
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
Cheers,
Viktor
viktor, what's the difference between OnChange and OnScroll ?
bryan
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
Cheers,
Viktor
ASKER
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.
VIKTORNET gave the right answer to my question.
Thanks a lot.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.