Solved

ScrollBar.Position

Posted on 1998-10-23
11
199 Views
Last Modified: 2010-04-06
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?
0
Comment
Question by:rainbowsoftware
  • 4
  • 3
  • 2
  • +1
11 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1344092
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
 

Author Comment

by:rainbowsoftware
ID: 1344095
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
 

Author Comment

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

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 3

Expert Comment

by:Matvey
ID: 1344097
Value := 100 - ScrollBar1.Position

Doesn't this work??

There must be more to it if you ask, right???
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1344098
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
 
LVL 3

Expert Comment

by:bryan7
ID: 1344099
yeah, just place the code viktor said in the OnChanrge event of the TrackBar.

bryan

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1344100
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
 
LVL 3

Expert Comment

by:bryan7
ID: 1344101
viktor,  what's the difference between OnChange and OnScroll ?

bryan

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1344102
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
 

Author Comment

by:rainbowsoftware
ID: 1344103
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
 
LVL 10

Accepted Solution

by:
viktornet earned 50 total points
ID: 1344104
K
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question