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
Solved

ScrollBar.Position

Posted on 1998-10-23
11
200 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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