RadTrackBar Range Indicators Location

1 Answer 58 Views
TrackBar
Dan
Top achievements
Rank 1
Iron
Iron
Dan asked on 25 Sep 2023, 01:48 PM | edited on 25 Sep 2023, 01:48 PM
Hello, 

I am trying to get the Location in Pixels of each of the Ranges Indicators  I defined in a RadTrackBar.
How can I make this happen?

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 26 Sep 2023, 08:53 AM

Hi Dan,

What I can suggest is to get the TrackBarThumbElement and use its PointToScreen() method which will return the position of the element on your monitor.

private void radButton1_Click(object sender, EventArgs e)
{
    foreach (TrackBarIndicatorElement item in this.radTrackBar1.TrackBarElement.BodyElement.IndicatorContainerElement.Children)
    {
        foreach ( var thumbIndicator in item.Children)
        {
            if (thumbIndicator is TrackBarThumbElement)
            {
                var position = thumbIndicator.PointToScreen(Point.Empty);
                Console.WriteLine(position.ToString());
            }
        }
    }
}

You can also check the attached project. Can you check it out and let me know if I am in the right direction?

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
TrackBar
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or