The UltraFormattedTextEditor has the property ScrollBarDisplayStyle. This property can be set with an enumerator, and the options in the enumerator are: Automatic, Always and Never. Is there a way for me to set the Vertical scrollbar to be Automatic and the horizontal scrollbar to Never show?
There's nothing exposed publically that would allow you to do this, but if your application will have reflection permissions, you could hack this with a CreationFilter:
public class CF : IUIElementCreationFilter{ public void AfterCreateChildElements(UIElement parent) { if (parent is FormattedLinkEmbeddableUIElement) { ScrollableAreaUIElement scrollElement = parent.GetDescendant(typeof(ScrollableAreaUIElement)) as ScrollableAreaUIElement; if (scrollElement != null) { PropertyInfo info = typeof(ScrollableAreaUIElement).GetProperty("HorizScrollbarVisible", BindingFlags.NonPublic | BindingFlags.Instance); if (info != null) info.SetValue(scrollElement, false, null); } } } public bool BeforeCreateChildElements(UIElement parent) { return false; }}
this.ultraFormattedTextEditor1.CreationFilter = new CF();
-Matt
Thank you very much! It works great.
-Glenn