0 0 Votes

Delphi/Lazarus: How to scroll already when moving the scrollbar

Question by Guest | 02/03/2018 at 11:26

While moving the slider of a scrollbar, the content remains unchanged by default - for example, at the scrollbox control. Only when you release the slider, the content of the box is moved to the right place.

Unfortunately, with this behavior, the user of my program does not know how far to move the slider. Is there any possibility that the shift takes place while moving the slider?

ReplyPositiveNegativeDateVotes

Delphian

Show Profile | Message
Avatar
0Best Answer
0 Votes

There is the property Tracking available at a scrollbar to change this behavior. By default, tracking is set to false, which causes your behavior as described. If you set tracking to true, scrolling will be done when moving the slider.

ScrollBox1.VertScrollBar.Tracking := true;
ScrollBox1.HorzScrollBar.Tracking := true;  

In the case of a TScrollBox, you can set the tracking property through the Object Inspector or in your code as shown above. As a rule, every control with a scrollbar should have this property.
03/03/2018 at 09:54

ReplyPositive Negative
00 Votes

Hi, if you want to set the Tracking to true as mentioned above, do you need to do it between the Begin/End captions or under the procedure?
30/06/2020 at 12:05

Positive Negative

Delphian

Show Profile | Message
Avatar
00 Votes

Statements like that are always written between begin and end. What do you mean with under the procedure?

The best is, just set it within the Object Inspector after clicking on the control. So, you do not have to write any code. If you want to do it in code, the best place would be the OnCreate procedure of your Form.
30/06/2020 at 15:03

Positive Negative
Reply

Related Topics

Scrollbar in DIV container
Question | 1 Answer

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.

Participate

Ask your own question or write your own articles on askingbox.com. How to do.