Class RichTextBox
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
[NotImplemented]
public class RichTextBox : Control
Constructors
| Improve this Doc View SourceRichTextBox()
Initializes a new instance of the RichTextBox class.
Declaration
[NotImplemented]
public RichTextBox()
Fields
| Improve this Doc View SourceAcceptsReturnProperty
Identifies the AcceptsReturn dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty AcceptsReturnProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CaretBrushProperty
Identifies the CaretBrush dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty CaretBrushProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
IsReadOnlyProperty
Identifies the IsReadOnly dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LineHeightProperty
Identifies the LineHeight dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty LineHeightProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LineStackingStrategyProperty
Identifies the LineStackingStrategy dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty LineStackingStrategyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TextAlignmentProperty
Identifies the TextAlignment dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty TextAlignmentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
TextWrappingProperty
Identifies the TextWrapping dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty TextWrappingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceAcceptsReturn
Gets or sets a value that determines whether the RichTextBox allows and displays the newline or return characters when the ENTER or RETURN keys are pressed.
Declaration
[NotImplemented]
public bool AcceptsReturn { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the RichTextBox allows newline characters; otherwise, false. The default is true. |
BaselineOffset
Gets a value that represents the offset in pixels from the top of the content to the baseline of the first paragraph. The baseline of the paragraph is the baseline of the first line in it.
Declaration
[NotImplemented]
public double BaselineOffset { get; }
Property Value
Type | Description |
---|---|
System.Double | The computed baseline for the first paragraph, or 0 if the RichTextBox is empty. |
Blocks
Gets the contents of the RichTextBox.
Declaration
[NotImplemented]
public BlockCollection Blocks { get; }
Property Value
Type | Description |
---|---|
BlockCollection | A BlockCollection that contains the contents of the RichTextBox. |
CaretBrush
Gets or sets the brush that is used to render the vertical bar that indicates the insertion point.
Declaration
[NotImplemented]
public Brush CaretBrush { get; set; }
Property Value
Type | Description |
---|---|
Brush | A brush that is used to render the vertical bar that indicates the insertion point. |
ContentEnd
Gets a TextPointer that indicates the end of content in the RichTextBox.
Declaration
[NotImplemented]
public TextPointer ContentEnd { get; }
Property Value
Type | Description |
---|---|
TextPointer | A TextPointer that indicates the end of content in the RichTextBox. |
ContentStart
Gets a TextPointer that indicates the start of content in the RichTextBox.
Declaration
[NotImplemented]
public TextPointer ContentStart { get; }
Property Value
Type | Description |
---|---|
TextPointer | A TextPointer that indicates the start of content in the RichTextBox. |
HorizontalScrollBarVisibility
Gets or sets the visibility of the horizontal scroll bar.
Declaration
[NotImplemented]
public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisibility | The visibility of the horizontal scroll bar. The default is Hidden. |
IsReadOnly
Gets or sets a value that determines whether the user can change the text in the RichTextBox. The default is false.
Declaration
[NotImplemented]
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
LineHeight
Gets or sets the height of each line of content.
Declaration
[NotImplemented]
public double LineHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of each line in pixels. A value of 0 indicates that the line height is determined automatically from the current font characteristics. The default is 0. |
LineStackingStrategy
Gets or sets a value that indicates how a line box is determined for each line of text in the RichTextBox.
Declaration
[NotImplemented]
public LineStackingStrategy LineStackingStrategy { get; set; }
Property Value
Type | Description |
---|---|
LineStackingStrategy | A value that indicates how a line box is determined for each line of text in the RichTextBox. The default is MaxHeight. |
Selection
Gets the TextSelection in the RichTextBox.
Declaration
[NotImplemented]
public TextSelection Selection { get; }
Property Value
Type | Description |
---|---|
TextSelection | A TextSelection that represents the selected text in the RichTextBox. |
TextAlignment
Gets or sets how the text should be aligned in the RichTextBox.
Declaration
[NotImplemented]
public TextAlignment TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
TextAlignment | One of the TextAlignment enumeration values. The default is Left. |
TextWrapping
Gets or sets how text wrapping occurs if a line of text extends beyond the available width of the RichTextBox.
Declaration
[NotImplemented]
public TextWrapping TextWrapping { get; set; }
Property Value
Type | Description |
---|---|
TextWrapping | One of the TextWrapping values. The default is Wrap. |
VerticalScrollBarVisibility
Gets or sets the visibility of the vertical scroll bar. The default is Auto.
Declaration
[NotImplemented]
public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
Property Value
Type | Description |
---|---|
ScrollBarVisibility |
Xaml
Gets or sets a XAML representation of the content in the RichTextBox.
Declaration
[NotImplemented]
public string Xaml { get; set; }
Property Value
Type | Description |
---|---|
System.String | A System.String object that is a XAML representation of the content in the RichTextBox. |
Methods
| Improve this Doc View SourceGetPositionFromPoint(Point)
Returns a TextPointer that indicates the closest insertion position for the specified point.
Declaration
[NotImplemented]
public TextPointer GetPositionFromPoint(Point point)
Parameters
Type | Name | Description |
---|---|---|
Point | point | A point in the coordinate space of the RichTextBox for which the closest insertion position is retrieved. |
Returns
Type | Description |
---|---|
TextPointer | A TextPointer that indicates the closest insertion position for the specified point. |
OnGotFocus(RoutedEventArgs)
Called before the GotFocus event occurs.
Declaration
[NotImplemented]
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnKeyDown(KeyEventArgs)
Called when the KeyDown event occurs.
Declaration
[NotImplemented]
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnKeyUp(KeyEventArgs)
Called before the KeyUp event occurs.
Declaration
[NotImplemented]
protected override void OnKeyUp(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnLostFocus(RoutedEventArgs)
Called before the LostFocus event occurs.
Declaration
[NotImplemented]
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
RoutedEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnLostMouseCapture(MouseEventArgs)
Provides handling for the LostMouseCapture event.
Declaration
[NotImplemented]
protected override void OnLostMouseCapture(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | A MouseEventArgs that contains the event data. |
Overrides
| Improve this Doc View SourceOnMouseEnter(MouseEventArgs)
Called before the MouseEnter event occurs.
Declaration
[NotImplemented]
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeave(MouseEventArgs)
Called before the MouseLeave event occurs.
Declaration
[NotImplemented]
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonDown(MouseButtonEventArgs)
Called before the MouseLeftButtonDown event occurs.
Declaration
[NotImplemented]
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseLeftButtonUp(MouseButtonEventArgs)
Called before the MouseLeftButtonUp event occurs.
Declaration
[NotImplemented]
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseButtonEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnMouseMove(MouseEventArgs)
Called before the MouseMove event occurs.
Declaration
[NotImplemented]
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnTextInput(TextCompositionEventArgs)
Called before the TextInput event occurs.
Declaration
[NotImplemented]
protected override void OnTextInput(TextCompositionEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TextCompositionEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnTextInputStart(TextCompositionEventArgs)
Called before the TextInputStart event occurs.
Declaration
[NotImplemented]
protected override void OnTextInputStart(TextCompositionEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TextCompositionEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceOnTextInputUpdate(TextCompositionEventArgs)
Called before the TextInputUpdate event occurs.
Declaration
[NotImplemented]
protected override void OnTextInputUpdate(TextCompositionEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TextCompositionEventArgs | e | The data for the event. |
Overrides
| Improve this Doc View SourceSelectAll()
Selects the entire contents in the RichTextBox.
Declaration
[NotImplemented]
public void SelectAll()
Events
| Improve this Doc View SourceContentChanged
Occurs when the content changes in a RichTextBox.
Declaration
[NotImplemented]
public event ContentChangedEventHandler ContentChanged
Event Type
Type | Description |
---|---|
ContentChangedEventHandler |
SelectionChanged
Occurs when the text selection has changed.
Declaration
[NotImplemented]
public event RoutedEventHandler SelectionChanged
Event Type
Type | Description |
---|---|
RoutedEventHandler |