Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
616
UltraScrollBar thumb
posted

Hellow.

How can I know coordinates of thumb of UltraScrollBar?

Thanks.

  • 469350
    Suggested Answer
    Offline posted

    Hi,

    What exactly do you mean by coordinates? Do you mean the scrollbar Position? Or do you mean the rectangle of the thumb element?

    The Position property is pretty obviously, so I assume you probably mean the rect. How you get that depends a little on why you need it and what you intend to do with it.

    Assuming the scrollbar is visible on the screen and has painted, you could do this using the UIElements.

    ScrollThumbUIElement scrollThumbUIElement = this.ultraScrollBar1.UIElement.GetDescendant(typeof(ScrollThumbUIElement)) as ScrollThumbUIElement;
                if (scrollThumbUIElement != null)
                {
                    Rectangle rect = scrollThumbUIElement.Rect;
                    // Do something with the rect here.
                }