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
850
Determine viewable area of UltraFormattedTextEditor
posted

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

  • 37774
    Verified Answer
    posted

    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