• Api Documentation
  • Source Code
Search Results for

    Show / Hide Table of Contents
    • MewExtendedToolkit
      • AboutBox
      • AboutBoxExtensions
      • InputBox
      • ObservableValueExtensions
      • SharpAppProperties
      • TransformBox
      • TransformBoxExtensions
      • Wizard
      • WizardExtensions
      • WizardPage
      • WizardPageExtensions
    • MewExtendedToolkit.Html
      • ControlExtensions
      • HtmlContainer
      • HtmlControl
      • HtmlLabel
      • HtmlPanel

    Class HtmlPanel

    Provides HTML rendering using the text property.
    MewUI control that will render html content in it's client rectangle.
    If the layout of the html resulted in its content beyond the client bounds of the panel it will show scrollbars (horizontal/vertical) allowing to scroll the content.
    The control will handle mouse and keyboard events on it to support html text selection, copy-paste and mouse clicks.

    Inheritance
    object
    MewObject
    Element
    UIElement
    FrameworkElement
    TextElement
    Control
    HtmlControl
    HtmlPanel
    Implements
    IDisposable
    IVisualTreeHost
    Inherited Members
    HtmlControl._htmlContainer
    HtmlControl._baseCssData
    HtmlControl._lastScrollOffset
    HtmlControl.AvoidImagesLateLoadingProperty
    HtmlControl.IsSelectionEnabledProperty
    HtmlControl.IsContextMenuEnabledProperty
    HtmlControl.BaseStylesheetProperty
    HtmlControl.TextProperty
    HtmlControl.LoadComplete
    HtmlControl.LinkClicked
    HtmlControl.RenderError
    HtmlControl.StylesheetLoad
    HtmlControl.ImageLoad
    HtmlControl.AvoidImagesLateLoading
    HtmlControl.IsSelectionEnabled
    HtmlControl.IsContextMenuEnabled
    HtmlControl.BaseStylesheet
    HtmlControl.Text
    HtmlControl.SelectedText
    HtmlControl.SelectedHtml
    HtmlControl.GetHtml()
    HtmlControl.GetElementRectangle(string)
    HtmlControl.ClearSelection()
    HtmlControl._mouseMovePoint
    HtmlControl.OnMouseMove(MouseEventArgs)
    HtmlControl.OnMouseLeave()
    HtmlControl.OnMouseDown(MouseEventArgs)
    HtmlControl.OnMouseDoubleClick(MouseEventArgs)
    HtmlControl.OnLoadComplete(EventArgs)
    HtmlControl.OnLinkClicked(HtmlLinkClickedEventArgs)
    HtmlControl.OnRenderError(HtmlRenderErrorEventArgs)
    HtmlControl.OnStylesheetLoad(HtmlStylesheetLoadEventArgs)
    HtmlControl.OnImageLoad(HtmlImageLoadEventArgs)
    HtmlControl.OnRefresh(HtmlRefreshEventArgs)
    HtmlControl.InvokeMouseMove()
    Control.BackgroundProperty
    Control.BorderBrushProperty
    Control.TemplateProperty
    Control.CornerRadiusProperty
    Control.BorderThicknessProperty
    Control.PaddingProperty
    Control.IsPressedProperty
    Control.HasValidationErrorProperty
    Control.ValidationErrorsProperty
    Control.SetPressed(bool)
    Control.ComputeVisualState()
    Control.OnVisualStateChanged(Control.VisualState, Control.VisualState)
    Control.EnsureStyleResolved()
    Control.ApplyTemplate()
    Control.OnApplyTemplate()
    Control.GetTemplateChild<T>(string)
    Control.MeasureContent(Size)
    Control.ArrangeContent(Rect)
    Control.RenderSubtree(IGraphicsContext)
    Control.ResolveVisualState(bool)
    Control.OnThemeChanged(Theme, Theme)
    Control.OnVisualRootChanged(Element, Element)
    Control.OnFontCacheInvalidated(MewProperty)
    Control.GetTextRunStyle()
    Control.MeasureEngineText(ReadOnlySpan<char>, double, TextWrapping, bool)
    Control.DrawEngineText(IGraphicsContext, ReadOnlySpan<char>, Rect, Color, TextAlignment, TextAlignment, TextWrapping, TextTrimming, object, bool)
    Control.PickAccentBorder(Theme, Color, in Control.VisualState, double)
    Control.PickButtonBackground(in Control.VisualState, Color?)
    Control.PickControlBackground(in Control.VisualState, Color?)
    Control.PickControlBackground(in Control.VisualState, Color)
    Control.GetBorderVisualInset()
    Control.DrawBackgroundAndBorder(IGraphicsContext, Rect, Color, Color, double, double)
    Control.DrawBackgroundAndBorder(IGraphicsContext, Rect, Color, Color, Thickness, CornerRadius)
    Control.Background
    Control.BorderBrush
    Control.CornerRadius
    Control.BorderThickness
    Control.Padding
    Control.ContentBounds
    Control.CurrentVisualState
    Control.IsPressed
    Control.HasValidationError
    Control.ValidationErrors
    Control.StyleName
    Control.Template
    TextElement.ForegroundProperty
    TextElement.FontFamilyProperty
    TextElement.FontSizeProperty
    TextElement.FontWeightProperty
    TextElement.FontStyleProperty
    TextElement.Foreground
    TextElement.FontFamily
    TextElement.FontSize
    TextElement.FontWeight
    TextElement.FontStyle
    FrameworkElement.ThemeProperty
    FrameworkElement.WidthProperty
    FrameworkElement.HeightProperty
    FrameworkElement.MinWidthProperty
    FrameworkElement.MinHeightProperty
    FrameworkElement.MaxWidthProperty
    FrameworkElement.MaxHeightProperty
    FrameworkElement.MarginProperty
    FrameworkElement.HorizontalAlignmentProperty
    FrameworkElement.VerticalAlignmentProperty
    FrameworkElement.TagProperty
    FrameworkElement.ToolTipProperty
    FrameworkElement.ContextMenuProperty
    FrameworkElement.OnMouseEnter()
    FrameworkElement.ResolveToolTipContent()
    FrameworkElement.GetDpi()
    FrameworkElement.Dispose()
    FrameworkElement.GetSnappedBorderBounds(Rect)
    FrameworkElement.GetGraphicsFactory()
    FrameworkElement.OnSizeChanged(SizeChangedEventArgs)
    FrameworkElement.GetArrangedBounds(Rect)
    FrameworkElement.ArrangeOverride(Size)
    FrameworkElement.StyleSheet
    FrameworkElement.ToolTip
    FrameworkElement.ContextMenu
    FrameworkElement.Width
    FrameworkElement.Height
    FrameworkElement.MinWidth
    FrameworkElement.MinHeight
    FrameworkElement.MaxWidth
    FrameworkElement.MaxHeight
    FrameworkElement.Margin
    FrameworkElement.HorizontalAlignment
    FrameworkElement.VerticalAlignment
    FrameworkElement.Tag
    FrameworkElement.ActualWidth
    FrameworkElement.ActualHeight
    FrameworkElement.Theme
    FrameworkElement.SizeChanged
    UIElement.CacheModeProperty
    UIElement.IsVisibleProperty
    UIElement.IsEnabledProperty
    UIElement.IsEffectivelyEnabledProperty
    UIElement.IsFocusedProperty
    UIElement.IsFocusWithinProperty
    UIElement.IsMouseOverProperty
    UIElement.IsMouseCapturedProperty
    UIElement.OpacityProperty
    UIElement.IsHitTestVisibleProperty
    UIElement.TabIndexProperty
    UIElement.IsTabStopProperty
    UIElement.FocusableProperty
    UIElement.SkipViewportCullProperty
    UIElement.CursorProperty
    UIElement.AllowDropProperty
    UIElement.CanDragProperty
    UIElement.InvalidateVisual()
    UIElement.OnParentChanged()
    UIElement.OnMewPropertyChanged(MewProperty)
    UIElement.MeasureCore(Size)
    UIElement.Render(IGraphicsContext)
    UIElement.InvalidateVisualState()
    UIElement.HitTest(Point)
    UIElement.Focus()
    UIElement.PointToScreen(Point)
    UIElement.PointFromScreen(Point)
    UIElement.RectToScreen(Rect)
    UIElement.RectFromScreen(Rect)
    UIElement.ComputeIsEnabledSuggestion()
    UIElement.OnGotFocus()
    UIElement.OnLostFocus()
    UIElement.OnKeyUp(KeyEventArgs)
    UIElement.OnVisibilityChanged()
    UIElement.OnEnabledChanged()
    UIElement.OnDragEnter(DragEventArgs)
    UIElement.OnDragOver(DragEventArgs)
    UIElement.OnDragLeave(DragEventArgs)
    UIElement.OnDrop(DragEventArgs)
    UIElement.OnDragStarting(DragStartingEventArgs)
    UIElement.OnDragCompleted(DragCompletedEventArgs)
    UIElement.BeginDrag(IDataObject, DragDropEffects, DragPreviewContent)
    UIElement.CacheMode
    UIElement.SkipViewportCull
    UIElement.IsVisible
    UIElement.IsEnabled
    UIElement.IsEffectivelyEnabled
    UIElement.Opacity
    UIElement.IsHitTestVisible
    UIElement.TabIndex
    UIElement.IsTabStop
    UIElement.Cursor
    UIElement.IsFocused
    UIElement.IsFocusWithin
    UIElement.IsMouseOver
    UIElement.IsMouseCaptured
    UIElement.Focusable
    UIElement.AllowDrop
    UIElement.CanDrag
    UIElement.Transitions
    UIElement.Triggers
    UIElement.GotFocus
    UIElement.LostFocus
    UIElement.MouseEnter
    UIElement.MouseLeave
    UIElement.MouseDown
    UIElement.MouseDoubleClick
    UIElement.MouseUp
    UIElement.MouseMove
    UIElement.MouseWheel
    UIElement.KeyDown
    UIElement.KeyUp
    UIElement.DragEnter
    UIElement.DragOver
    UIElement.DragLeave
    UIElement.Drop
    UIElement.DragStarting
    UIElement.DragCompleted
    Element.Set<T>(ref T, T)
    Element.SetDouble(ref double, double)
    Element.AttachChild(Element)
    Element.DetachChild(Element)
    Element.AttachLogicalChild(Element)
    Element.DetachLogicalChild(Element)
    Element.OnLogicalChildTaken(Element)
    Element.ValidateLogicalChild(Element, bool)
    Element.ChangeLogicalChild(Element, Element)
    Element.FindLogicalRoot()
    Element.OnLogicalParentChanged()
    Element.OnLogicalRootChanged(Element, Element)
    Element.Measure(Size)
    Element.Arrange(Rect)
    Element.InvalidateMeasure()
    Element.InvalidateArrange()
    Element.InvalidateArrangeForCurrentLayoutPass()
    Element.FindVisualRoot()
    Element.IsAncestorOf(Element)
    Element.IsDescendantOf(Element)
    Element.TransformToAncestor(Element)
    Element.TransformToDescendant(Element)
    Element.TransformToVisual(Element)
    Element.TranslatePoint(Point, Element)
    Element.TranslateRect(Rect, Element)
    Element.ResolveInheritedValue<T>(MewProperty<T>)
    Element.Commands
    Element.InputMap
    Element.DesiredSize
    Element.RenderSize
    Element.Parent
    Element.LogicalParent
    Element.IsMeasureDirty
    Element.IsArrangeDirty
    MewObject.OnValueSourceChanged(MewProperty)
    MewObject.GetValue<T>(MewProperty<T>)
    MewObject.SetValue<T>(MewProperty<T>, T)
    MewObject.SetCurrentValue<T>(MewProperty<T>, T)
    MewObject.CommitTargetValue<T>(MewProperty<T>, T)
    MewObject.ClearLocalValue<T>(MewProperty<T>)
    MewObject.SetValue<T>(MewPropertyKey<T>, T)
    MewObject.CoerceValue<T>(MewProperty<T>)
    MewObject.SetBinding<T>(MewProperty<T>, ObservableValue<T>, BindingMode?)
    MewObject.SetBinding<TProp, TSource>(MewProperty<TProp>, ObservableValue<TSource>, Func<TSource, TProp>, Func<TProp, TSource>, BindingMode?)
    MewObject.SetBinding<TRoot, T>(MewProperty<T>, TRoot, BindingPath<TRoot, T>, BindingMode?, T)
    MewObject.SetBinding<TProp, TRoot, TSource>(MewProperty<TProp>, TRoot, BindingPath<TRoot, TSource>, Func<TSource, TProp>, Func<TProp, TSource>, BindingMode?, TProp)
    MewObject.SetBinding<TSource, T>(MewProperty<T>, TSource, Func<TSource, T>, Action<TSource, T>, BindingMode?, string)
    MewObject.SetBinding<TProp, TSource, TValue>(MewProperty<TProp>, TSource, Func<TSource, TValue>, Func<TValue, TProp>, Action<TSource, TValue>, Func<TProp, TValue>, BindingMode?, string)
    MewObject.SetBinding<TSource, T>(MewProperty<T>, TSource, Func<TSource, ObservableValue<T>>, BindingMode?)
    MewObject.ClearBinding<T>(MewProperty<T>)
    MewObject.SetBinding<T>(MewProperty<T>, MewObject, MewProperty<T>)
    MewObject.SetBinding<TProp, TSource>(MewProperty<TProp>, MewObject, MewProperty<TSource>, Func<TSource, TProp>, Func<TProp, TSource>, BindingMode?)
    MewObject.DisposePropertyBindings()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: MewExtendedToolkit.Html
    Assembly: MewExtendedToolkit.Html.dll
    Syntax
    public class HtmlPanel : HtmlControl, IDisposable, IVisualTreeHost
    Remarks

    See HtmlControl for more info.

    Constructors

    | Edit this page View Source

    HtmlPanel()

    Creates a new HtmlPanel and sets a basic css for it's styling.

    Declaration
    public HtmlPanel()

    Fields

    | Edit this page View Source

    LargeChangeFactor

    Declaration
    protected const double LargeChangeFactor = 0.9
    Field Value
    Type Description
    double
    | Edit this page View Source

    SmallChange

    Declaration
    protected const double SmallChange = 25
    Field Value
    Type Description
    double
    | Edit this page View Source

    _horizontalScrollBarValue

    Declaration
    protected readonly ObservableValue<double> _horizontalScrollBarValue
    Field Value
    Type Description
    ObservableValue<double>
    | Edit this page View Source

    _verticalScrollBarValue

    Declaration
    protected readonly ObservableValue<double> _verticalScrollBarValue
    Field Value
    Type Description
    ObservableValue<double>

    Methods

    | Edit this page View Source

    ArrangeCore(Rect)

    Core arrangement logic. Override in derived classes.

    Declaration
    protected override void ArrangeCore(Rect finalRect)
    Parameters
    Type Name Description
    Rect finalRect
    Overrides
    Aprillz.MewUI.Controls.FrameworkElement.ArrangeCore(Aprillz.MewUI.Rect)
    | Edit this page View Source

    HtmlHeight(Size)

    Get the width the HTML has to render in (not including vertical scroll iff it is visible)

    Declaration
    protected override double HtmlHeight(Size size)
    Parameters
    Type Name Description
    Size size
    Returns
    Type Description
    double
    Overrides
    HtmlControl.HtmlHeight(Size)
    | Edit this page View Source

    HtmlWidth(Size)

    Get the width the HTML has to render in (not including vertical scroll iff it is visible)

    Declaration
    protected override double HtmlWidth(Size size)
    Parameters
    Type Name Description
    Size size
    Returns
    Type Description
    double
    Overrides
    HtmlControl.HtmlWidth(Size)
    | Edit this page View Source

    MeasureOverride(Size)

    Perform the layout of the html in the control.

    Declaration
    protected override Size MeasureOverride(Size constraint)
    Parameters
    Type Name Description
    Size constraint
    Returns
    Type Description
    Size
    Overrides
    Aprillz.MewUI.Controls.Control.MeasureOverride(Aprillz.MewUI.Size)
    | Edit this page View Source

    OnDispose()

    Called when the element is being disposed. Override to release resources.

    Declaration
    protected override void OnDispose()
    Overrides
    Aprillz.MewUI.Controls.FrameworkElement.OnDispose()
    | Edit this page View Source

    OnDpiChanged(uint, uint)

    Called when the DPI changes.

    Declaration
    protected override void OnDpiChanged(uint oldDpi, uint newDpi)
    Parameters
    Type Name Description
    uint oldDpi

    The old DPI value.

    uint newDpi

    The new DPI value.

    Overrides
    Control.OnDpiChanged(uint, uint)
    | Edit this page View Source

    OnHitTest(Point)

    Declaration
    protected override UIElement? OnHitTest(Point point)
    Parameters
    Type Name Description
    Point point
    Returns
    Type Description
    UIElement
    Overrides
    Aprillz.MewUI.Controls.UIElement.OnHitTest(Aprillz.MewUI.Point)
    | Edit this page View Source

    OnKeyDown(KeyEventArgs)

    Handle key down event for selection, copy and scrollbars handling.

    Declaration
    protected override void OnKeyDown(KeyEventArgs e)
    Parameters
    Type Name Description
    KeyEventArgs e
    Overrides
    HtmlControl.OnKeyDown(KeyEventArgs)
    | Edit this page View Source

    OnMouseUp(MouseEventArgs)

    Handle mouse up to set focus on the control.

    Declaration
    protected override void OnMouseUp(MouseEventArgs e)
    Parameters
    Type Name Description
    MouseEventArgs e
    Overrides
    HtmlControl.OnMouseUp(MouseEventArgs)
    | Edit this page View Source

    OnMouseWheel(MouseWheelEventArgs)

    Handle mouse wheel for scrolling.

    Declaration
    protected override void OnMouseWheel(MouseWheelEventArgs e)
    Parameters
    Type Name Description
    MouseWheelEventArgs e
    Overrides
    Aprillz.MewUI.Controls.UIElement.OnMouseWheel(Aprillz.MewUI.MouseWheelEventArgs)
    | Edit this page View Source

    OnRender(IGraphicsContext)

    Handle minor case where both scroll are visible and create a rectangle at the bottom right corner between them.

    Declaration
    protected override void OnRender(IGraphicsContext context)
    Parameters
    Type Name Description
    IGraphicsContext context
    Overrides
    HtmlControl.OnRender(IGraphicsContext)
    | Edit this page View Source

    PerformHtmlLayout(Size)

    Perform html container layout by the current panel client size.

    Declaration
    protected Size PerformHtmlLayout(Size constraint)
    Parameters
    Type Name Description
    Size constraint
    Returns
    Type Description
    Size
    | Edit this page View Source

    ScrollToElement(string)

    Adjust the scrollbar of the panel on html element by the given id.
    The top of the html element rectangle will be at the top of the panel, if there is not enough height to scroll to the top the scroll will be at maximum.

    Declaration
    public virtual void ScrollToElement(string elementId)
    Parameters
    Type Name Description
    string elementId

    the id of the element to scroll to

    | Edit this page View Source

    ScrollToPoint(double, double)

    Set the control scroll offset to the given values.

    Declaration
    public void ScrollToPoint(double x, double y)
    Parameters
    Type Name Description
    double x
    double y
    | Edit this page View Source

    TextPropertyChanged(string)

    On text property change reset the scrollbars to zero.

    Declaration
    protected override void TextPropertyChanged(string n)
    Parameters
    Type Name Description
    string n
    Overrides
    HtmlControl.TextPropertyChanged(string)

    Implements

    IDisposable
    Aprillz.MewUI.IVisualTreeHost

    Extension Methods

    ControlExtensions.LoadRtfFile(HtmlControl, Stream)
    ControlExtensions.LoadRtfFile(HtmlControl, string)
    ControlExtensions.LoadRtfText(HtmlControl, string)
    ControlExtensions.Text(HtmlControl, string)
    • Edit this page
    • View Source
    In this article
    Back to top Copyright (c) 2026 Jérémy Ansel