Solved

ScrollBar.Position

Posted on 1998-10-23
11
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

697 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