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?
rainbowsoftwareAsked:
Who is Participating?
 
viktornetCommented:
K
0
 
MatveyCommented:
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...
0
 
rainbowsoftwareAuthor Commented:
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.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
rainbowsoftwareAuthor Commented:
Sorry, now I'm confusing myself.
When in top it must show 100 and when on the bottom 0 (zero).

0
 
MatveyCommented:
Value := 100 - ScrollBar1.Position

Doesn't this work??

There must be more to it if you ask, right???
0
 
viktornetCommented:
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
0
 
bryan7Commented:
yeah, just place the code viktor said in the OnChanrge event of the TrackBar.

bryan

0
 
viktornetCommented:
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
0
 
bryan7Commented:
viktor,  what's the difference between OnChange and OnScroll ?

bryan

0
 
viktornetCommented:
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
0
 
rainbowsoftwareAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.