This is a migrated thread and some comments may be shown as answers.

Custom images for track bar buttons

3 Answers 61 Views
TrackBar
This is a migrated thread and some comments may be shown as answers.
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Toby asked on 07 Jan 2021, 03:03 PM

Hi, I was wondering how I could specify my own images (from my project resource file) for the buttons in a vertical track bar. Is this possible? if so how?

I probably need to do this at run-time due as the user is able to change themes which I suspect will cause things to go wrong.

 

Regards

Toby

 

3 Answers, 1 is accepted

Sort by
0
Toby
Top achievements
Rank 3
Iron
Iron
Iron
answered on 07 Jan 2021, 04:12 PM

You'll be pleased to know I read the help and found the solution at https://docs.telerik.com/devtools/winforms/controls/track-and-status-controls/trackbar/customizing-appearance/accessing-and-customizing-element

0
Toby
Top achievements
Rank 3
Iron
Iron
Iron
answered on 07 Jan 2021, 06:46 PM
But on a similar theme is it possible to set the colour of the indicator bar at run time ?
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 08 Jan 2021, 02:09 PM

Hello, Toby,

If I understand you correctly, you would like to change the color of the indicator that shows the progress in RadTrackBar. In order to achieve this, please refer to the following code snippet:

TrackBarIndicatorElement indicator = this.radTrackBar1.TrackBarElement.BodyElement.IndicatorContainerElement.Children[0] as TrackBarIndicatorElement;
indicator.RangeElement.BackColor = Color.Lime;
indicator.RangeElement.GradientStyle = GradientStyles.Solid;

I hope this helps. Should you have other questions please let me know.

Regards,
Nadya
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
TrackBar
Asked by
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Nadya | Tech Support Engineer
Telerik team
Share this question
or