Hi,
I would like to see if horizontal scrollbar is visible in a ultraformattedtextbox and what heigth it has? How can I do this?
Thanks
Emil
Hi Emil,
ScrollBar height is a system setting, so you can get the height from the SystemInformation class:
SystemInformation.HorizontalScrollBarHeight
As to whether or not the horizontal scrollbar is visible, as long as the FormattedTextEditor is visible and has painted at least once, you could get this using the UIElements:
private bool HasHorizontalScrollBar(UltraFormattedTextEditor ultraFormattedTextEditor) { ScrollableAreaUIElement scrollableAreaUIElement = ultraFormattedTextEditor.UIElement.GetDescendant(typeof(ScrollableAreaUIElement)) as ScrollableAreaUIElement; if (scrollableAreaUIElement != null) { foreach(UIElement element in scrollableAreaUIElement.ChildElements) { ScrollBarUIElement scrollBarUIElement = element as ScrollBarUIElement; if (scrollBarUIElement != null) { if (scrollBarUIElement.Orientation == Orientation.Horizontal) { return true; } } } } return false; }