RichTextBox Class

Definition

Represents a rich editing control which operates on FlowDocument objects.

[System.Windows.Localizability(System.Windows.LocalizationCategory.Inherit)]
[System.Windows.Markup.ContentProperty("Document")]
public class RichTextBox : System.Windows.Controls.Primitives.TextBoxBase, System.Windows.Markup.IAddChild
Inheritance
Attributes
Implements

Examples

The following example declares a RichTextBox that contains a simple FlowDocument.

<RichTextBox Name="richTB">
  <FlowDocument>
    <Paragraph>
      <Run>Paragraph 1</Run>
    </Paragraph>
    <Paragraph>
      <Run>Paragraph 2</Run>
    </Paragraph>
    <Paragraph>
      <Run>Paragraph 3</Run>
    </Paragraph>
  </FlowDocument>
</RichTextBox>
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Documents;
namespace SDKSample
{
    public partial class RichTextBoxExample : Page
    {
        public RichTextBoxExample()
        {

            StackPanel myStackPanel = new StackPanel();

            // Create a FlowDocument to contain content for the RichTextBox.
            FlowDocument myFlowDoc = new FlowDocument();

            // Add paragraphs to the FlowDocument.
            myFlowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 1")));
            myFlowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 2")));
            myFlowDoc.Blocks.Add(new Paragraph(new Run("Paragraph 3")));
            RichTextBox myRichTextBox = new RichTextBox();

            // Add initial content to the RichTextBox.
            myRichTextBox.Document = myFlowDoc;
            
            myStackPanel.Children.Add(myRichTextBox);
            this.Content = myStackPanel;
            
        }
    }
}

Imports System
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Media
Imports System.Windows.Documents
Namespace SDKSample
	Partial Public Class RichTextBoxExample
		Inherits Page
		Public Sub New()

			Dim myStackPanel As New StackPanel()

			' Create a FlowDocument to contain content for the RichTextBox.
			Dim myFlowDoc As New FlowDocument()

			' Add paragraphs to the FlowDocument.
			myFlowDoc.Blocks.Add(New Paragraph(New Run("Paragraph 1")))
			myFlowDoc.Blocks.Add(New Paragraph(New Run("Paragraph 2")))
			myFlowDoc.Blocks.Add(New Paragraph(New Run("Paragraph 3")))
			Dim myRichTextBox As New RichTextBox()

			' Add initial content to the RichTextBox.
			myRichTextBox.Document = myFlowDoc

			myStackPanel.Children.Add(myRichTextBox)
			Me.Content = myStackPanel

		End Sub
	End Class
End Namespace

Remarks

FlowDocument is the only supported child element for a RichTextBox.

Important

RichTextBox has built-in handling for the bubbling MouseUp and MouseDown events. Consequently, custom event handlers that listen for MouseUp or MouseDown events from a RichTextBox will never be called. If you need to respond to these events, listen for the tunneling PreviewMouseUp and PreviewMouseDown events instead, or register the handlers with the HandledEventsToo argument (this latter option is only available through code). Do not mark the event handled unless you deliberately want to disable RichTextBox native handling of these events, and be aware that this has notable effects on the control's UI.

While RichTextBox supports copying and pasting of images, certain scenarios are currently unsupported and may not work properly. The following table summarizes these scenarios and expected results.

Image Copy Source Image Paste Result
Image source is a graphic metafile No image is pasted
Image source uses relative path or link Garbled or blank image is pasted
Image source link does not end with an expected image format (.PNG, .JPG, .GIF) Garbled or blank image is pasted
Image source copied from malformed RichText (RTF) Link to image source is pasted (rather than image)

Pasting HTML content into a RichTextBox might result in unexpected behavior because RichTextBox uses RTF format rather than directly using HTML format.

Text always wraps in a RichTextBox. If you do not want text to wrap then set the PageWidth on the FlowDocument to be larger than the width of the RichTextBox. However, once the page width is reached the text still wraps.

Horizontally and vertically aligning content within a RichTextBox is done with the HorizontalContentAlignment and VerticalContentAlignment properties. Aligning the RichTextBox within the layout of the page is done with the HorizontalAlignment and VerticalAlignment properties.

Scrollbars are not visible on a RichTextBox by default. To make a scrollbar visible, set the VerticalScrollBarVisibility property to Visible or Auto.

Usually, the TextChanged event should be used to detect when the text in a TextBox or RichTextBox changes, rather then KeyDown as you might expect. For an example, see How to: Detect When Text in a TextBox Has Changed.

RichTextBox supports a variety of keyboard commands. For a list of keyboard commands, see EditingCommands.

Dependency properties for this control might be set by the control’s default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running. For more information, see Default WPF Themes.

Constructors

RichTextBox()

Initializes a new, default instance of the RichTextBox class.

RichTextBox(FlowDocument)

Initializes a new instance of the RichTextBox class, adding a specified FlowDocument as the initial content.

Fields

AcceptsReturnProperty Inherited from TextBoxBase
AcceptsTabProperty Inherited from TextBoxBase
ActualHeightProperty Inherited from FrameworkElement
ActualWidthProperty Inherited from FrameworkElement
AllowDropProperty Inherited from UIElement
AreAnyTouchesCapturedProperty Inherited from UIElement
AreAnyTouchesCapturedWithinProperty Inherited from UIElement
AreAnyTouchesDirectlyOverProperty Inherited from UIElement
AreAnyTouchesOverProperty Inherited from UIElement
AutoWordSelectionProperty Inherited from TextBoxBase
BackgroundProperty Inherited from Control
BindingGroupProperty Inherited from FrameworkElement
BitmapEffectInputProperty Inherited from UIElement
BitmapEffectProperty Inherited from UIElement
BorderBrushProperty Inherited from Control
BorderThicknessProperty Inherited from Control
CacheModeProperty Inherited from UIElement
CaretBrushProperty Inherited from TextBoxBase
ClipProperty Inherited from UIElement
ClipToBoundsProperty Inherited from UIElement
ContextMenuClosingEvent Inherited from FrameworkElement
ContextMenuOpeningEvent Inherited from FrameworkElement
ContextMenuProperty Inherited from FrameworkElement
CursorProperty Inherited from FrameworkElement
DataContextProperty Inherited from FrameworkElement
DefaultStyleKeyProperty Inherited from FrameworkElement
DragEnterEvent Inherited from UIElement
DragLeaveEvent Inherited from UIElement
DragOverEvent Inherited from UIElement
DropEvent Inherited from UIElement
EffectProperty Inherited from UIElement
FlowDirectionProperty Inherited from FrameworkElement
FocusVisualStyleProperty Inherited from FrameworkElement
FocusableProperty Inherited from UIElement
FontFamilyProperty Inherited from Control
FontSizeProperty Inherited from Control
FontStretchProperty Inherited from Control
FontStyleProperty Inherited from Control
FontWeightProperty Inherited from Control
ForceCursorProperty Inherited from FrameworkElement
ForegroundProperty Inherited from Control
GiveFeedbackEvent Inherited from UIElement
GotFocusEvent Inherited from UIElement
GotKeyboardFocusEvent Inherited from UIElement
GotMouseCaptureEvent Inherited from UIElement
GotStylusCaptureEvent Inherited from UIElement
GotTouchCaptureEvent Inherited from UIElement
HeightProperty Inherited from FrameworkElement
HorizontalAlignmentProperty Inherited from FrameworkElement
HorizontalContentAlignmentProperty Inherited from Control
HorizontalScrollBarVisibilityProperty Inherited from TextBoxBase
InputScopeProperty Inherited from FrameworkElement
IsDocumentEnabledProperty

Identifies the IsDocumentEnabled dependency property.

IsEnabledProperty Inherited from UIElement
IsFocusedProperty Inherited from UIElement
IsHitTestVisibleProperty Inherited from UIElement
IsInactiveSelectionHighlightEnabledProperty Inherited from TextBoxBase
IsKeyboardFocusWithinProperty Inherited from UIElement
IsKeyboardFocusedProperty Inherited from UIElement
IsManipulationEnabledProperty Inherited from UIElement
IsMouseCaptureWithinProperty Inherited from UIElement
IsMouseCapturedProperty Inherited from UIElement
IsMouseDirectlyOverProperty Inherited from UIElement
IsMouseOverProperty Inherited from UIElement
IsReadOnlyCaretVisibleProperty Inherited from TextBoxBase
IsReadOnlyProperty Inherited from TextBoxBase
IsSelectionActiveProperty Inherited from TextBoxBase
IsStylusCaptureWithinProperty Inherited from UIElement
IsStylusCapturedProperty Inherited from UIElement
IsStylusDirectlyOverProperty Inherited from UIElement
IsStylusOverProperty Inherited from UIElement
IsTabStopProperty Inherited from Control
IsUndoEnabledProperty Inherited from TextBoxBase
IsVisibleProperty Inherited from UIElement
KeyDownEvent Inherited from UIElement
KeyUpEvent Inherited from UIElement
LanguageProperty Inherited from FrameworkElement
LayoutTransformProperty Inherited from FrameworkElement
LoadedEvent Inherited from FrameworkElement
LostFocusEvent Inherited from UIElement
LostKeyboardFocusEvent Inherited from UIElement
LostMouseCaptureEvent Inherited from UIElement
LostStylusCaptureEvent Inherited from UIElement
LostTouchCaptureEvent Inherited from UIElement
ManipulationBoundaryFeedbackEvent Inherited from UIElement
ManipulationCompletedEvent Inherited from UIElement
ManipulationDeltaEvent Inherited from UIElement
ManipulationInertiaStartingEvent Inherited from UIElement
ManipulationStartedEvent Inherited from UIElement
ManipulationStartingEvent Inherited from UIElement
MarginProperty Inherited from FrameworkElement
MaxHeightProperty Inherited from FrameworkElement
MaxWidthProperty Inherited from FrameworkElement
MinHeightProperty Inherited from FrameworkElement
MinWidthProperty Inherited from FrameworkElement
MouseDoubleClickEvent Inherited from Control
MouseDownEvent Inherited from UIElement
MouseEnterEvent Inherited from UIElement
MouseLeaveEvent Inherited from UIElement
MouseLeftButtonDownEvent Inherited from UIElement
MouseLeftButtonUpEvent Inherited from UIElement
MouseMoveEvent Inherited from UIElement
MouseRightButtonDownEvent Inherited from UIElement
MouseRightButtonUpEvent Inherited from UIElement
MouseUpEvent Inherited from UIElement
MouseWheelEvent Inherited from UIElement
NameProperty Inherited from FrameworkElement
OpacityMaskProperty Inherited from UIElement
OpacityProperty Inherited from UIElement
OverridesDefaultStyleProperty Inherited from FrameworkElement
PaddingProperty Inherited from Control
PreviewDragEnterEvent Inherited from UIElement
PreviewDragLeaveEvent Inherited from UIElement
PreviewDragOverEvent Inherited from UIElement
PreviewDropEvent Inherited from UIElement
PreviewGiveFeedbackEvent Inherited from UIElement
PreviewGotKeyboardFocusEvent Inherited from UIElement
PreviewKeyDownEvent Inherited from UIElement
PreviewKeyUpEvent Inherited from UIElement
PreviewLostKeyboardFocusEvent Inherited from UIElement
PreviewMouseDoubleClickEvent Inherited from Control
PreviewMouseDownEvent Inherited from UIElement
PreviewMouseLeftButtonDownEvent Inherited from UIElement
PreviewMouseLeftButtonUpEvent Inherited from UIElement
PreviewMouseMoveEvent Inherited from UIElement
PreviewMouseRightButtonDownEvent Inherited from UIElement
PreviewMouseRightButtonUpEvent Inherited from UIElement
PreviewMouseUpEvent Inherited from UIElement
PreviewMouseWheelEvent Inherited from UIElement
PreviewQueryContinueDragEvent Inherited from UIElement
PreviewStylusButtonDownEvent Inherited from UIElement
PreviewStylusButtonUpEvent Inherited from UIElement
PreviewStylusDownEvent Inherited from UIElement
PreviewStylusInAirMoveEvent Inherited from UIElement
PreviewStylusInRangeEvent Inherited from UIElement
PreviewStylusMoveEvent Inherited from UIElement
PreviewStylusOutOfRangeEvent Inherited from UIElement
PreviewStylusSystemGestureEvent Inherited from UIElement
PreviewStylusUpEvent Inherited from UIElement
PreviewTextInputEvent Inherited from UIElement
PreviewTouchDownEvent Inherited from UIElement
PreviewTouchMoveEvent Inherited from UIElement
PreviewTouchUpEvent Inherited from UIElement
QueryContinueDragEvent Inherited from UIElement
QueryCursorEvent Inherited from UIElement
RenderTransformOriginProperty Inherited from UIElement
RenderTransformProperty Inherited from UIElement
RequestBringIntoViewEvent Inherited from FrameworkElement
SelectionBrushProperty Inherited from TextBoxBase
SelectionChangedEvent Inherited from TextBoxBase
SelectionOpacityProperty Inherited from TextBoxBase
SizeChangedEvent Inherited from FrameworkElement
SnapsToDevicePixelsProperty Inherited from UIElement
StyleProperty Inherited from FrameworkElement
StylusButtonDownEvent Inherited from UIElement
StylusButtonUpEvent Inherited from UIElement
StylusDownEvent Inherited from UIElement
StylusEnterEvent Inherited from UIElement
StylusInAirMoveEvent Inherited from UIElement
StylusInRangeEvent Inherited from UIElement
StylusLeaveEvent Inherited from UIElement
StylusMoveEvent Inherited from UIElement
StylusOutOfRangeEvent Inherited from UIElement
StylusSystemGestureEvent Inherited from UIElement
StylusUpEvent Inherited from UIElement
TabIndexProperty Inherited from Control
TagProperty Inherited from FrameworkElement
TemplateProperty Inherited from Control
TextChangedEvent Inherited from TextBoxBase
TextInputEvent Inherited from UIElement
ToolTipClosingEvent Inherited from FrameworkElement
ToolTipOpeningEvent Inherited from FrameworkElement
ToolTipProperty Inherited from FrameworkElement
TouchDownEvent Inherited from UIElement
TouchEnterEvent Inherited from UIElement
TouchLeaveEvent Inherited from UIElement
TouchMoveEvent Inherited from UIElement
TouchUpEvent Inherited from UIElement
UidProperty Inherited from UIElement
UndoLimitProperty Inherited from TextBoxBase
UnloadedEvent Inherited from FrameworkElement
UseLayoutRoundingProperty Inherited from FrameworkElement
VerticalAlignmentProperty Inherited from FrameworkElement
VerticalContentAlignmentProperty Inherited from Control
VerticalScrollBarVisibilityProperty Inherited from TextBoxBase
VisibilityProperty Inherited from UIElement
WidthProperty Inherited from FrameworkElement

Properties

AcceptsReturn Inherited from TextBoxBase
AcceptsTab Inherited from TextBoxBase
ActualHeight Inherited from FrameworkElement
ActualWidth Inherited from FrameworkElement
AllowDrop Inherited from UIElement
AreAnyTouchesCaptured Inherited from UIElement
AreAnyTouchesCapturedWithin Inherited from UIElement
AreAnyTouchesDirectlyOver Inherited from UIElement
AreAnyTouchesOver Inherited from UIElement
AutoWordSelection Inherited from TextBoxBase
Background Inherited from Control
BindingGroup Inherited from FrameworkElement
BitmapEffect Inherited from UIElement
BitmapEffectInput Inherited from UIElement
BorderBrush Inherited from Control
BorderThickness Inherited from Control
CacheMode Inherited from UIElement
CanRedo Inherited from TextBoxBase
CanUndo Inherited from TextBoxBase
CaretBrush Inherited from TextBoxBase
CaretPosition

Gets or sets the position of the input caret.

Clip Inherited from UIElement
ClipToBounds Inherited from UIElement
CommandBindings Inherited from UIElement
ContextMenu Inherited from FrameworkElement
Cursor Inherited from FrameworkElement
DataContext Inherited from FrameworkElement
DefaultStyleKey Inherited from FrameworkElement
DependencyObjectType Inherited from DependencyObject
DesiredSize Inherited from UIElement
Dispatcher Inherited from DispatcherObject
Document

Gets or sets the FlowDocument that represents the contents of the RichTextBox.

Effect Inherited from UIElement
ExtentHeight Inherited from TextBoxBase
ExtentWidth Inherited from TextBoxBase
FlowDirection Inherited from FrameworkElement
FocusVisualStyle Inherited from FrameworkElement
Focusable Inherited from UIElement
FontFamily Inherited from Control
FontSize Inherited from Control
FontStretch Inherited from Control
FontStyle Inherited from Control
FontWeight Inherited from Control
ForceCursor Inherited from FrameworkElement
Foreground Inherited from Control
HandlesScrolling Inherited from Control
HasAnimatedProperties Inherited from UIElement
HasEffectiveKeyboardFocus Inherited from UIElement
Height Inherited from FrameworkElement
HorizontalAlignment Inherited from FrameworkElement
HorizontalContentAlignment Inherited from Control
HorizontalOffset Inherited from TextBoxBase
HorizontalScrollBarVisibility Inherited from TextBoxBase
InheritanceBehavior Inherited from FrameworkElement
InputBindings Inherited from UIElement
InputScope Inherited from FrameworkElement
IsArrangeValid Inherited from UIElement
IsDocumentEnabled

Gets or sets a value that indicates whether the user can interact with UIElement and ContentElement objects within the RichTextBox.

IsEnabled Inherited from UIElement
IsEnabledCore Inherited from UIElement
IsFocused Inherited from UIElement
IsHitTestVisible Inherited from UIElement
IsInactiveSelectionHighlightEnabled Inherited from TextBoxBase
IsInitialized Inherited from FrameworkElement
IsInputMethodEnabled Inherited from UIElement
IsKeyboardFocusWithin Inherited from UIElement
IsKeyboardFocused Inherited from UIElement
IsLoaded Inherited from FrameworkElement
IsManipulationEnabled Inherited from UIElement
IsMeasureValid Inherited from UIElement
IsMouseCaptureWithin Inherited from UIElement
IsMouseCaptured Inherited from UIElement
IsMouseDirectlyOver Inherited from UIElement
IsMouseOver Inherited from UIElement
IsReadOnly Inherited from TextBoxBase
IsReadOnlyCaretVisible Inherited from TextBoxBase
IsSealed Inherited from DependencyObject
IsSelectionActive Inherited from TextBoxBase
IsStylusCaptureWithin Inherited from UIElement
IsStylusCaptured Inherited from UIElement
IsStylusDirectlyOver Inherited from UIElement
IsStylusOver Inherited from UIElement
IsTabStop Inherited from Control
IsUndoEnabled Inherited from TextBoxBase
IsVisible Inherited from UIElement
Language Inherited from FrameworkElement
LayoutTransform Inherited from FrameworkElement
LogicalChildren

Gets an enumerator that can iterate the logical children of the RichTextBox.

Margin Inherited from FrameworkElement
MaxHeight Inherited from FrameworkElement
MaxWidth Inherited from FrameworkElement
MinHeight Inherited from FrameworkElement
MinWidth Inherited from FrameworkElement
Name Inherited from FrameworkElement
Opacity Inherited from UIElement
OpacityMask Inherited from UIElement
OverridesDefaultStyle Inherited from FrameworkElement
Padding Inherited from Control
Parent Inherited from FrameworkElement
PersistId Inherited from UIElement
RenderSize Inherited from UIElement
RenderTransform Inherited from UIElement
RenderTransformOrigin Inherited from UIElement
Resources Inherited from FrameworkElement
Selection

Gets a TextSelection object containing the current selection in the RichTextBox.

SelectionBrush Inherited from TextBoxBase
SelectionOpacity Inherited from TextBoxBase
SnapsToDevicePixels Inherited from UIElement
SpellCheck Inherited from TextBoxBase
Style Inherited from FrameworkElement
StylusPlugIns Inherited from UIElement
TabIndex Inherited from Control
Tag Inherited from FrameworkElement
Template Inherited from Control
TemplatedParent Inherited from FrameworkElement
ToolTip Inherited from FrameworkElement
TouchesCaptured Inherited from UIElement
TouchesCapturedWithin Inherited from UIElement
TouchesDirectlyOver Inherited from UIElement
TouchesOver Inherited from UIElement
Triggers Inherited from FrameworkElement
Uid Inherited from UIElement
UndoLimit Inherited from TextBoxBase
UseLayoutRounding Inherited from FrameworkElement
VerticalAlignment Inherited from FrameworkElement
VerticalContentAlignment Inherited from Control
VerticalOffset Inherited from TextBoxBase
VerticalScrollBarVisibility Inherited from TextBoxBase
ViewportHeight Inherited from TextBoxBase
ViewportWidth Inherited from TextBoxBase
Visibility Inherited from UIElement
VisualBitmapEffect Inherited from Visual
VisualBitmapEffectInput Inherited from Visual
VisualBitmapScalingMode Inherited from Visual
VisualCacheMode Inherited from Visual
VisualChildrenCount Inherited from FrameworkElement
VisualClearTypeHint Inherited from Visual
VisualClip Inherited from Visual
VisualEdgeMode Inherited from Visual
VisualEffect Inherited from Visual
VisualOffset Inherited from Visual
VisualOpacity Inherited from Visual
VisualOpacityMask Inherited from Visual
VisualParent Inherited from Visual
VisualScrollableAreaClip Inherited from Visual
VisualTextHintingMode Inherited from Visual
VisualTextRenderingMode Inherited from Visual
VisualTransform Inherited from Visual
VisualXSnappingGuidelines Inherited from Visual
VisualYSnappingGuidelines Inherited from Visual
Width Inherited from FrameworkElement

Methods

AddHandler(RoutedEvent, Delegate) Inherited from UIElement
AddHandler(RoutedEvent, Delegate, Boolean) Inherited from UIElement
AddLogicalChild(Object) Inherited from FrameworkElement
AddToEventRoute(EventRoute, RoutedEventArgs) Inherited from UIElement
AddVisualChild(Visual) Inherited from Visual
AppendText(String) Inherited from TextBoxBase
ApplyAnimationClock(DependencyProperty, AnimationClock) Inherited from UIElement
ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) Inherited from UIElement
ApplyTemplate() Inherited from FrameworkElement
Arrange(Rect) Inherited from UIElement
ArrangeCore(Rect) Inherited from FrameworkElement
ArrangeOverride(Size) Inherited from Control
BeginAnimation(DependencyProperty, AnimationTimeline) Inherited from UIElement
BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) Inherited from UIElement
BeginChange() Inherited from TextBoxBase
BeginInit() Inherited from FrameworkElement
BeginStoryboard(Storyboard) Inherited from FrameworkElement
BeginStoryboard(Storyboard, HandoffBehavior) Inherited from FrameworkElement
BeginStoryboard(Storyboard, HandoffBehavior, Boolean) Inherited from FrameworkElement
BringIntoView() Inherited from FrameworkElement
BringIntoView(Rect) Inherited from FrameworkElement
CaptureMouse() Inherited from UIElement
CaptureStylus() Inherited from UIElement
CaptureTouch(TouchDevice) Inherited from UIElement
CheckAccess() Inherited from DispatcherObject
ClearValue(DependencyProperty) Inherited from DependencyObject
ClearValue(DependencyPropertyKey) Inherited from DependencyObject
CoerceValue(DependencyProperty) Inherited from DependencyObject
Copy() Inherited from TextBoxBase
Cut() Inherited from TextBoxBase
DeclareChangeBlock() Inherited from TextBoxBase
EndChange() Inherited from TextBoxBase
EndInit() Inherited from FrameworkElement
Equals(Object) Inherited from DependencyObject
Equals(Object, Object) Inherited from Object
FindCommonVisualAncestor(DependencyObject) Inherited from Visual
FindName(String) Inherited from FrameworkElement
FindResource(Object) Inherited from FrameworkElement
Focus() Inherited from UIElement
GetAnimationBaseValue(DependencyProperty) Inherited from UIElement
GetBindingExpression(DependencyProperty) Inherited from FrameworkElement
GetFlowDirection(DependencyObject) Inherited from FrameworkElement
GetHashCode() Inherited from DependencyObject
GetLayoutClip(Size) Inherited from FrameworkElement
GetLocalValueEnumerator() Inherited from DependencyObject
GetNextSpellingErrorPosition(TextPointer, LogicalDirection)

Returns a TextPointer that points to the next spelling error in the contents of the RichTextBox.

GetPositionFromPoint(Point, Boolean)

Returns a TextPointer that points to the insertion point closest to the specified position.

GetSpellingError(TextPointer)

Returns a SpellingError object associated with any spelling error at a specified position in the contents of the RichTextBox.

GetSpellingErrorRange(TextPointer)

Returns a TextRange object covering any misspelled word at a specified position in the contents of the RichTextBox.

GetTemplateChild(String) Inherited from FrameworkElement
GetType() Inherited from Object
GetUIParentCore() Inherited from FrameworkElement
GetValue(DependencyProperty) Inherited from DependencyObject
GetVisualChild(Int32) Inherited from FrameworkElement
HitTestCore(GeometryHitTestParameters) Inherited from UIElement
HitTestCore(PointHitTestParameters) Inherited from UIElement
IQueryAmbient.IsAmbientPropertyAvailable(String) Inherited from FrameworkElement
InputHitTest(Point) Inherited from UIElement
InvalidateArrange() Inherited from UIElement
InvalidateMeasure() Inherited from UIElement
InvalidateProperty(DependencyProperty) Inherited from DependencyObject
InvalidateVisual() Inherited from UIElement
IsAncestorOf(DependencyObject) Inherited from Visual
IsDescendantOf(DependencyObject) Inherited from Visual
LineDown() Inherited from TextBoxBase
LineLeft() Inherited from TextBoxBase
LineRight() Inherited from TextBoxBase
LineUp() Inherited from TextBoxBase
LockCurrentUndoUnit() Inherited from TextBoxBase
Measure(Size) Inherited from UIElement
MeasureCore(Size) Inherited from FrameworkElement
MeasureOverride(Size)

Called to re-measure the RichTextBox.

MemberwiseClone() Inherited from Object
MoveFocus(TraversalRequest) Inherited from FrameworkElement
OnAccessKey(AccessKeyEventArgs) Inherited from UIElement
OnApplyTemplate() Inherited from TextBoxBase
OnChildDesiredSizeChanged(UIElement) Inherited from UIElement
OnContextMenuClosing(ContextMenuEventArgs) Inherited from FrameworkElement
OnContextMenuOpening(ContextMenuEventArgs) Inherited from TextBoxBase
OnCreateAutomationPeer()

Creates and returns an AutomationPeer object for this RichTextBox.

OnDpiChanged(DpiScale, DpiScale)

Called when the DPI at which this Rich Text Box is rendered changes.

OnDragEnter(DragEventArgs) Inherited from TextBoxBase
OnDragLeave(DragEventArgs) Inherited from TextBoxBase
OnDragOver(DragEventArgs) Inherited from TextBoxBase
OnDrop(DragEventArgs) Inherited from TextBoxBase
OnGiveFeedback(GiveFeedbackEventArgs) Inherited from TextBoxBase
OnGotFocus(RoutedEventArgs) Inherited from FrameworkElement
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs) Inherited from TextBoxBase
OnGotMouseCapture(MouseEventArgs) Inherited from UIElement
OnGotStylusCapture(StylusEventArgs) Inherited from UIElement
OnGotTouchCapture(TouchEventArgs) Inherited from UIElement
OnInitialized(EventArgs) Inherited from FrameworkElement
OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsMouseCaptureWithinChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsMouseCapturedChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsMouseDirectlyOverChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsStylusCaptureWithinChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsStylusCapturedChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnIsStylusDirectlyOverChanged(DependencyPropertyChangedEventArgs) Inherited from UIElement
OnKeyDown(KeyEventArgs) Inherited from TextBoxBase
OnKeyUp(KeyEventArgs) Inherited from TextBoxBase
OnLostFocus(RoutedEventArgs) Inherited from TextBoxBase
OnLostKeyboardFocus(KeyboardFocusChangedEventArgs) Inherited from TextBoxBase
OnLostMouseCapture(MouseEventArgs) Inherited from UIElement
OnLostStylusCapture(StylusEventArgs) Inherited from UIElement
OnLostTouchCapture(TouchEventArgs) Inherited from UIElement
OnManipulationBoundaryFeedback(ManipulationBoundaryFeedbackEventArgs) Inherited from UIElement
OnManipulationCompleted(ManipulationCompletedEventArgs) Inherited from UIElement
OnManipulationDelta(ManipulationDeltaEventArgs) Inherited from UIElement
OnManipulationInertiaStarting(ManipulationInertiaStartingEventArgs) Inherited from UIElement
OnManipulationStarted(ManipulationStartedEventArgs) Inherited from UIElement
OnManipulationStarting(ManipulationStartingEventArgs) Inherited from UIElement
OnMouseDoubleClick(MouseButtonEventArgs) Inherited from Control
OnMouseDown(MouseButtonEventArgs) Inherited from TextBoxBase
OnMouseEnter(MouseEventArgs) Inherited from UIElement
OnMouseLeave(MouseEventArgs) Inherited from UIElement
OnMouseLeftButtonDown(MouseButtonEventArgs) Inherited from UIElement
OnMouseLeftButtonUp(MouseButtonEventArgs) Inherited from UIElement
OnMouseMove(MouseEventArgs) Inherited from TextBoxBase
OnMouseRightButtonDown(MouseButtonEventArgs) Inherited from UIElement
OnMouseRightButtonUp(MouseButtonEventArgs) Inherited from UIElement
OnMouseUp(MouseButtonEventArgs) Inherited from TextBoxBase
OnMouseWheel(MouseWheelEventArgs) Inherited from TextBoxBase
OnPreviewDragEnter(DragEventArgs) Inherited from UIElement
OnPreviewDragLeave(DragEventArgs) Inherited from UIElement
OnPreviewDragOver(DragEventArgs) Inherited from UIElement
OnPreviewDrop(DragEventArgs) Inherited from UIElement
OnPreviewGiveFeedback(GiveFeedbackEventArgs) Inherited from UIElement
OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs) Inherited from UIElement
OnPreviewKeyDown(KeyEventArgs) Inherited from TextBoxBase
OnPreviewKeyUp(KeyEventArgs) Inherited from UIElement
OnPreviewLostKeyboardFocus(KeyboardFocusChangedEventArgs) Inherited from UIElement
OnPreviewMouseDoubleClick(MouseButtonEventArgs) Inherited from Control
OnPreviewMouseDown(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseLeftButtonUp(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseMove(MouseEventArgs) Inherited from UIElement
OnPreviewMouseRightButtonDown(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseRightButtonUp(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseUp(MouseButtonEventArgs) Inherited from UIElement
OnPreviewMouseWheel(MouseWheelEventArgs) Inherited from UIElement
OnPreviewQueryContinueDrag(QueryContinueDragEventArgs) Inherited from UIElement
OnPreviewStylusButtonDown(StylusButtonEventArgs) Inherited from UIElement
OnPreviewStylusButtonUp(StylusButtonEventArgs) Inherited from UIElement
OnPreviewStylusDown(StylusDownEventArgs) Inherited from UIElement
OnPreviewStylusInAirMove(StylusEventArgs) Inherited from UIElement
OnPreviewStylusInRange(StylusEventArgs) Inherited from UIElement
OnPreviewStylusMove(StylusEventArgs) Inherited from UIElement
OnPreviewStylusOutOfRange(StylusEventArgs) Inherited from UIElement
OnPreviewStylusSystemGesture(StylusSystemGestureEventArgs) Inherited from UIElement
OnPreviewStylusUp(StylusEventArgs) Inherited from UIElement
OnPreviewTextInput(TextCompositionEventArgs) Inherited from UIElement
OnPreviewTouchDown(TouchEventArgs) Inherited from UIElement
OnPreviewTouchMove(TouchEventArgs) Inherited from UIElement
OnPreviewTouchUp(TouchEventArgs) Inherited from UIElement
OnPropertyChanged(DependencyPropertyChangedEventArgs) Inherited from FrameworkElement
OnQueryContinueDrag(QueryContinueDragEventArgs) Inherited from TextBoxBase
OnQueryCursor(QueryCursorEventArgs) Inherited from TextBoxBase
OnRender(DrawingContext) Inherited from UIElement
OnRenderSizeChanged(SizeChangedInfo) Inherited from FrameworkElement
OnSelectionChanged(RoutedEventArgs) Inherited from TextBoxBase
OnStyleChanged(Style, Style) Inherited from FrameworkElement
OnStylusButtonDown(StylusButtonEventArgs) Inherited from UIElement
OnStylusButtonUp(StylusButtonEventArgs) Inherited from UIElement
OnStylusDown(StylusDownEventArgs) Inherited from UIElement
OnStylusEnter(StylusEventArgs) Inherited from UIElement
OnStylusInAirMove(StylusEventArgs) Inherited from UIElement
OnStylusInRange(StylusEventArgs) Inherited from UIElement
OnStylusLeave(StylusEventArgs) Inherited from UIElement
OnStylusMove(StylusEventArgs) Inherited from UIElement
OnStylusOutOfRange(StylusEventArgs) Inherited from UIElement
OnStylusSystemGesture(StylusSystemGestureEventArgs) Inherited from UIElement
OnStylusUp(StylusEventArgs) Inherited from UIElement
OnTemplateChanged(ControlTemplate, ControlTemplate) Inherited from TextBoxBase
OnTextChanged(TextChangedEventArgs) Inherited from TextBoxBase
OnTextInput(TextCompositionEventArgs) Inherited from TextBoxBase
OnToolTipClosing(ToolTipEventArgs) Inherited from FrameworkElement
OnToolTipOpening(ToolTipEventArgs) Inherited from FrameworkElement
OnTouchDown(TouchEventArgs) Inherited from UIElement
OnTouchEnter(TouchEventArgs) Inherited from UIElement
OnTouchLeave(TouchEventArgs) Inherited from UIElement
OnTouchMove(TouchEventArgs) Inherited from UIElement
OnTouchUp(TouchEventArgs) Inherited from UIElement
OnVisualChildrenChanged(DependencyObject, DependencyObject) Inherited from Visual
OnVisualParentChanged(DependencyObject) Inherited from FrameworkElement
PageDown() Inherited from TextBoxBase
PageLeft() Inherited from TextBoxBase
PageRight() Inherited from TextBoxBase
PageUp() Inherited from TextBoxBase
ParentLayoutInvalidated(UIElement) Inherited from FrameworkElement
Paste() Inherited from TextBoxBase
PointFromScreen(Point) Inherited from Visual
PointToScreen(Point) Inherited from Visual
PredictFocus(FocusNavigationDirection) Inherited from FrameworkElement
RaiseEvent(RoutedEventArgs) Inherited from UIElement
ReadLocalValue(DependencyProperty) Inherited from DependencyObject
Redo() Inherited from TextBoxBase
ReferenceEquals(Object, Object) Inherited from Object
RegisterName(String, Object) Inherited from FrameworkElement
ReleaseAllTouchCaptures() Inherited from UIElement
ReleaseMouseCapture() Inherited from UIElement
ReleaseStylusCapture() Inherited from UIElement
ReleaseTouchCapture(TouchDevice) Inherited from UIElement
RemoveHandler(RoutedEvent, Delegate) Inherited from UIElement
RemoveLogicalChild(Object) Inherited from FrameworkElement
RemoveVisualChild(Visual) Inherited from Visual
ScrollToEnd() Inherited from TextBoxBase
ScrollToHome() Inherited from TextBoxBase
ScrollToHorizontalOffset(Double) Inherited from TextBoxBase
ScrollToVerticalOffset(Double) Inherited from TextBoxBase
SelectAll() Inherited from TextBoxBase
SetBinding(DependencyProperty, BindingBase) Inherited from FrameworkElement
SetBinding(DependencyProperty, String) Inherited from FrameworkElement
SetCurrentValue(DependencyProperty, Object) Inherited from DependencyObject
SetFlowDirection(DependencyObject, FlowDirection) Inherited from FrameworkElement
SetResourceReference(DependencyProperty, Object) Inherited from FrameworkElement
SetValue(DependencyProperty, Object) Inherited from DependencyObject
SetValue(DependencyPropertyKey, Object) Inherited from DependencyObject
ShouldSerializeCommandBindings() Inherited from UIElement
ShouldSerializeDocument()

Returns a value that indicates whether or not the effective value of the Document property should be serialized during serialization of a RichTextBox object.

ShouldSerializeInputBindings() Inherited from UIElement
ShouldSerializeProperty(DependencyProperty) Inherited from DependencyObject
ShouldSerializeResources() Inherited from FrameworkElement
ShouldSerializeStyle() Inherited from FrameworkElement
ShouldSerializeTriggers() Inherited from FrameworkElement
ToString() Inherited from Control
TransformToAncestor(Visual) Inherited from Visual
TransformToAncestor(Visual3D) Inherited from Visual
TransformToDescendant(Visual) Inherited from Visual
TransformToVisual(Visual) Inherited from Visual
TranslatePoint(Point, UIElement) Inherited from UIElement
TryFindResource(Object) Inherited from FrameworkElement
Undo() Inherited from TextBoxBase
UnregisterName(String) Inherited from FrameworkElement
UpdateDefaultStyle() Inherited from FrameworkElement
UpdateLayout() Inherited from UIElement
VerifyAccess() Inherited from DispatcherObject

Explicit Interface Implementations

IAddChild.AddChild(Object)

This type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

IAddChild.AddText(String)

This type or member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code.

Events

ContextMenuClosing Inherited from FrameworkElement
ContextMenuOpening Inherited from FrameworkElement
DataContextChanged Inherited from FrameworkElement
DragEnter Inherited from UIElement
DragLeave Inherited from UIElement
DragOver Inherited from UIElement
Drop Inherited from UIElement
FocusableChanged Inherited from UIElement
GiveFeedback Inherited from UIElement
GotFocus Inherited from UIElement
GotKeyboardFocus Inherited from UIElement
GotMouseCapture Inherited from UIElement
GotStylusCapture Inherited from UIElement
GotTouchCapture Inherited from UIElement
Initialized Inherited from FrameworkElement
IsEnabledChanged Inherited from UIElement
IsHitTestVisibleChanged Inherited from UIElement
IsKeyboardFocusWithinChanged Inherited from UIElement
IsKeyboardFocusedChanged Inherited from UIElement
IsMouseCaptureWithinChanged Inherited from UIElement
IsMouseCapturedChanged Inherited from UIElement
IsMouseDirectlyOverChanged Inherited from UIElement
IsStylusCaptureWithinChanged Inherited from UIElement
IsStylusCapturedChanged Inherited from UIElement
IsStylusDirectlyOverChanged Inherited from UIElement
IsVisibleChanged Inherited from UIElement
KeyDown Inherited from UIElement
KeyUp Inherited from UIElement
LayoutUpdated Inherited from UIElement
Loaded Inherited from FrameworkElement
LostFocus Inherited from UIElement
LostKeyboardFocus Inherited from UIElement
LostMouseCapture Inherited from UIElement
LostStylusCapture Inherited from UIElement
LostTouchCapture Inherited from UIElement
ManipulationBoundaryFeedback Inherited from UIElement
ManipulationCompleted Inherited from UIElement
ManipulationDelta Inherited from UIElement
ManipulationInertiaStarting Inherited from UIElement
ManipulationStarted Inherited from UIElement
ManipulationStarting Inherited from UIElement
MouseDoubleClick Inherited from Control
MouseDown Inherited from UIElement
MouseEnter Inherited from UIElement
MouseLeave Inherited from UIElement
MouseLeftButtonDown Inherited from UIElement
MouseLeftButtonUp Inherited from UIElement
MouseMove Inherited from UIElement
MouseRightButtonDown Inherited from UIElement
MouseRightButtonUp Inherited from UIElement
MouseUp Inherited from UIElement
MouseWheel Inherited from UIElement
PreviewDragEnter Inherited from UIElement
PreviewDragLeave Inherited from UIElement
PreviewDragOver Inherited from UIElement
PreviewDrop Inherited from UIElement
PreviewGiveFeedback Inherited from UIElement
PreviewGotKeyboardFocus Inherited from UIElement
PreviewKeyDown Inherited from UIElement
PreviewKeyUp Inherited from UIElement
PreviewLostKeyboardFocus Inherited from UIElement
PreviewMouseDoubleClick Inherited from Control
PreviewMouseDown Inherited from UIElement
PreviewMouseLeftButtonDown Inherited from UIElement
PreviewMouseLeftButtonUp Inherited from UIElement
PreviewMouseMove Inherited from UIElement
PreviewMouseRightButtonDown Inherited from UIElement
PreviewMouseRightButtonUp Inherited from UIElement
PreviewMouseUp Inherited from UIElement
PreviewMouseWheel Inherited from UIElement
PreviewQueryContinueDrag Inherited from UIElement
PreviewStylusButtonDown Inherited from UIElement
PreviewStylusButtonUp Inherited from UIElement
PreviewStylusDown Inherited from UIElement
PreviewStylusInAirMove Inherited from UIElement
PreviewStylusInRange Inherited from UIElement
PreviewStylusMove Inherited from UIElement
PreviewStylusOutOfRange Inherited from UIElement
PreviewStylusSystemGesture Inherited from UIElement
PreviewStylusUp Inherited from UIElement
PreviewTextInput Inherited from UIElement
PreviewTouchDown Inherited from UIElement
PreviewTouchMove Inherited from UIElement
PreviewTouchUp Inherited from UIElement
QueryContinueDrag Inherited from UIElement
QueryCursor Inherited from UIElement
RequestBringIntoView Inherited from FrameworkElement
SelectionChanged Inherited from TextBoxBase
SizeChanged Inherited from FrameworkElement
SourceUpdated Inherited from FrameworkElement
StylusButtonDown Inherited from UIElement
StylusButtonUp Inherited from UIElement
StylusDown Inherited from UIElement
StylusEnter Inherited from UIElement
StylusInAirMove Inherited from UIElement
StylusInRange Inherited from UIElement
StylusLeave Inherited from UIElement
StylusMove Inherited from UIElement
StylusOutOfRange Inherited from UIElement
StylusSystemGesture Inherited from UIElement
StylusUp Inherited from UIElement
TargetUpdated Inherited from FrameworkElement
TextChanged Inherited from TextBoxBase
TextInput Inherited from UIElement
ToolTipClosing Inherited from FrameworkElement
ToolTipOpening Inherited from FrameworkElement
TouchDown Inherited from UIElement
TouchEnter Inherited from UIElement
TouchLeave Inherited from UIElement
TouchMove Inherited from UIElement
TouchUp Inherited from UIElement
Unloaded Inherited from FrameworkElement

Applies to