Solved

ScrollBar.Position

Posted on 1998-10-23
11
196 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now