Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link trackbar

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
Is it possible to link 2 trackbar together?
I have trackbar1 and trackbar2. When i move one, i would like the other one to move too and vice-versa.
Thanks.
PO
 
Yes, it is very easy.

Check out the Delphi help for TTrackBar.

You want the position of the slider of TrackBar2 to relate to the position of TrackBar1 when it Changes.

IMHO, the help in Delphi is quite good.

Andrew
Hampshire, UK
 
Well, thanks but i did check the help before I posted the question and did not find what i was looking for.
So a little bit of coding on what to write in the on change event would help.
Thanks.
PO
PS: Maybe i'm not that good with searching the help.
 
Tek-Tips is not meant to be a free coding service!

Your original requirement is not clear. Let's assume that you want the slider in TrackBar2 to be the same as the position of the slider in TrackBar1 when TrackBar1 changes.

You should have found from the Help that the attribute that describes the position of the Slider in a TTrackBar component is called Position. I hinted at that in my previous reply and Delphi Help also gives clues:
Read Position to determine the current value represented by the track bar.
and
Set Position to programmatically move the slider of the track bar to a new value.

You should have enough to code the OnChange event handler. If you can't get it to work then post your code here.

Andrew
Hampshire, UK
 
Thanks, after my post, i did dig into the help better and did find out on how to do it.
I was too impatient. The first reply got me on the right track...
PO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top