Is their an easy way to determine how big the viewable area of a UltraformattedTexteditor is? I need to scroll my highlighted text into view and cannot find an easy way to determine how big the visible area is.
Thanks,
blair
Blair,
I don't think there is anything exposed that will tell you this (at least that I saw while quickly looking through the properties). However, you could certainly get at it by accessing the ContainerElement, which is the UIElement that is contained in the editor but does not include the scrollbars. I used the following code:
Rectangle size = Rectangle.Empty;Infragistics.Win.FormattedLinkLabel.ScrollableAreaUIElement.ContainerElement element = this.ultraFormattedTextEditor1.UIElement.GetDescendant(typeof(Infragistics.Win.FormattedLinkLabel.ScrollableAreaUIElement.ContainerElement)) as Infragistics.Win.FormattedLinkLabel.ScrollableAreaUIElement.ContainerElement;if (element != null) size = element.RectInsideBorders;
Keep in mind that the UIElements will have to have been created in order to rely on this information, so the control will have to have painted. You could probably force the elements to be created if necessary through "this.ultraFormattedTextEditor1.UIElement.VerifyChildElements();" if necessary, though.
-Matt