
The WPF.TextControl class class implements a control with high-level text editing features. It is inherited from the WPF.TextControlFrameworkElement class which is inherited from the System.Windows.FrameworkElement class. The following describes only the properties, methods and events defined through this class. For a list of inherited properties, methods and events see the .NET Framework reference. The WPF.TextControl class implements the IFormattedText interface.
Introduced: 16.0.
[C#]
public class TextControl : TextControlFrameworkElement, IFormattedText
[Visual Basic]
Public Class TextControl
Inherits TextControlFrameworkElement
Implements IFormattedText
| Constructor | Description | |
| WPF.TextControl | Initializes a new instance of the WPF.TextControl class. |
| Property | Description | |
| AcceptsTab | Gets or sets a value indicating whether pressing the TAB key types a TAB character in the control instead of moving the focus to the next control in the tab order. | |
| AllowDrag | Gets or sets a value indicating whether the control can be a source of a Drag&Drop operation. | |
| AllowDrop | Inherited from System.Windows.UIElement. | |
| ApplicationFields | Gets a collection of all Microsoft Word or Heiler HighEdit fields that have been created or imported from a Microsoft Word or RTF document. | |
| AutoControlSize | Gets or sets values that enable automatic expansion or shrinking of a Text Control's width or height depending on the currently contained text. | |
| Baseline | Gets or sets the baseline alignment, in twips, of the Text Control. | |
| BorderThickness | Gets or sets the border thickness of the Text Control. | |
| ButtonBar | Specifies the button bar control to be used with a TextControl. | |
| CanCopy | Informs whether a part of a Text Control document has been selected and can be copied to the clipboard. | |
| CanPaste | Informs whether the clipboard contains a format that can be pasted into a Text Control document. | |
| CanRedo | Informs whether an operation can be re-done using the Redo method. | |
| CanUndo | Gets a value indicating whether the user can undo the previous operation in a Text Control. | |
| CaretWidth | Gets or sets the width of the caret in pixels. | |
| ControlChars | Specifies if control characters are visible or not. | |
| DisplayColors | Gets or sets the colors of the text control. | |
| DocumentLinks | Gets a collection of all links that point to targets in the same document. | |
| DocumentTargetMarkers | Gets or sets a value indicating that markers for hypertext targets are shown or not. | |
| DocumentTargets | Gets a collection of all targets in the document. | |
| DropFormats | Gets or sets the formats of data the control can accept when the user drags it onto the control. | |
| EditMode | Gets or sets a value indicating whether text in the Text Control is read-only, can be selected or is editable. | |
| FieldCursor | Gets or sets the cursor that is displayed when the mouse pointer is over a marked text field. | |
| FontFamily | Gets or sets the font family of the text control. | |
| FontSettings | Gets a FontSettings object which provides properties determining which fonts can be used in a document. | |
| FontSize | Gets or sets the font size of the text control in device-independent units (1/96th inch). | |
| FontStyle | Gets or sets the font style of the text control. | |
| FontUnderlineStyle | Gets or sets the underlining style for the text displayed by the control. | |
| FontWeight | Gets or sets the weight or thickness of the text control's font. | |
| FormattingPrinter | Gets or sets the name of a printer the text dimensions and capabilities of which are used to format the document. | |
| GetPages | Gets a collection of all pages in the document. | |
| HeaderFooterActivationStyle | Gets or sets a value specifying the activation style for headers and footers. | |
| HeaderFooterFrameStyle | Gets or sets a value specifying the frame for activated headers and footers. | |
| HeadersAndFooters | Gets a collection of all headers and footers the current document contains. | |
| HideSelection | Gets or sets a value indicating whether the selected text in the Text Control remains highlighted when the control loses focus. | |
| HorizontalScrollBarVisibility | Gets or sets a value that indicates whether a horizontal scroll bar is shown. | |
| HypertextLinks | Gets a collection of all hypertext links contained in the text part with the input focus. | |
| Images | Gets a collection of all images contained in the text part with the input focus. | |
| InlineStyles | Gets a collection of all inline styles the current document contains. | |
| InputFormat | Gets an object of the type InputFormat which represents all formatting attributes at the current text input position. | |
| InputPosition | Gets or sets the current text input position. | |
| InsertionMode | Specifies whether text is inserted or overwrites existing text. | |
| IsSpellCheckingEnabled | Gets or sets a value indicating whether spell checking is active or not. | |
| IsTabStop | Gets or sets a value that indicates whether a text control is included in tab navigation. | |
| IsUndoEnabled | Gets or sets a value indicating whether the undo buffer is active or not. | |
| Landscape | Gets or sets a value indicating whether the page orientation is landscape or portrait. | |
| Lines | Gets a collection of all lines contained in the text part with the input focus. | |
| ListFormat | Gets or sets the type and the formatting attributes of a bulleted or numbered list. | |
| MisspelledWords | Gets a collection of all misspelled words contained in the text part with the input focus. | |
| PageMargins | Gets or sets the margins for the pages of the current document. | |
| Pages | Gets the number of pages contained in the current document. | |
| PageSize | Specifies the width and height of the pages for the current document. | |
| PageUnit | Gets or sets the measure used for page sizes and page margins. | |
| ParagraphFormat | Gets or sets the paragraph formatting attributes of the text displayed by the control. | |
| Paragraphs | Gets a collection of all paragraphs contained in the text part with the input focus. | |
| ParagraphStyles | Gets a collection of all paragraph styles the current document contains. | |
| RedoActionName | Gets a string that represents the name of the action that will be performed when a call to the Redo method is made. | |
| RulerBar | Specifies the horizontal ruler bar control to be used with a TextControl. | |
| ScrollLocation | Gets or sets the coordinates, in twips, of the upper-left corner of the document's visible part relative to the upper-left corner of the complete document. | |
| Sections | Gets a collection of all sections in the document. | |
| Selection | Gets or sets the current selection in the text part with the input focus. | |
| SelectionViewMode | Specifies whether text selections are displayed with a transparent bitmap or through inverting the text. | |
| SpellChecker | Specifies the spell checking component to be used with a TextControl. | |
| StatusBar | Specifies the status bar control to be used with a TextControl. | |
| TabIndex | Gets or sets the tab index of the text control. | |
| Tables | Gets a collection of all tables contained in the text part with the input focus. | |
| Text | Gets or sets the text contents of the text control. | |
| TextChars | Gets a collection of all characters contained in the text part with the input focus. | |
| TextFields | Gets a collection of all standard text fields contained in the text part with the input focus. | |
| TextFrameMarkerLines | Specifies whether text frames that have no border line are shown with marker lines. | |
| TextFrames | Gets a collection of all text frames the current document contains. | |
| TextParts | Gets a collection of all text parts the current document contains. | |
| UndoActionName | Gets a string that represents the name of the action that will be performed when a call to the Undo method is made. | |
| VerticalRulerBar | Specifies the vertical ruler bar control to be used with a TextControl. | |
| VerticalScrollBarVisibility | Gets or sets a value that indicates whether a vertical scroll bar is shown. | |
| ViewMode | Gets or sets the mode in which Text Control displays its contents. | |
| XmlEditMode | Gets or sets a value specifying whether Text Control operates in an edit mode that validates the XML document according to the document's DTD. | |
| ZoomFactor | Gets or sets the zoom factor, in percent, for a Text Control. |
| Method | Description | |
| Append | Loads text in a certain format from a file, a byte array or a string and appends it to the existing document. | |
| Clear | Clears the selected text or the character right from the current input position from the Text Control. | |
| ClearUndo | Clears the undo buffer of the Text Control. | |
| Copy | Copies the current selection in the Text Control to the Clipboard. | |
| Cut | Moves the current selection in the Text Control to the Clipboard. | |
| Find | Finds a text string in the text part with the input focus. | |
| FontDialog | Invokes the built-in font dialog box. | |
| FormattingStylesDialog | Invokes the built-in dialog box for creating, deleting and modifying formatting styles. | |
| GetClipboardFormats | Returns an array of ClipboardFormat values. | |
| GetXmlElements | Returns a collection of XML elements. | |
| ImageAttributesDialog | Invokes the built-in dialog box for setting attributes of images. | |
| ListFormatDialog | Invokes the built-in dialog box for setting formatting attributes of bulleted and numbered lists. | |
| Load | Loads text in a certain format from a file, a byte array or a string. | |
| OnAdaptFont | Raises the AdaptFont event. | |
| OnChanged | Raises the Changed event. | |
| OnCharFormatChanged | Raises the CharFormatChanged event. | |
| OnDocumentLinkClicked | Raises the DocumentLinkClicked event. | |
| OnFormattingStyleListChanged | Raises the FormattingStyleListChanged event. | |
| OnHeaderFooterActivated | Raises the HeaderFooterActivated event. | |
| OnHeaderFooterDeactivated | Raises the HeaderFooterDeactivated event. | |
| OnHExpanded | Raises the HExpanded event. | |
| OnHScroll | Raises the HScroll event. | |
| OnHShrunk | Raises the HShrunk event. | |
| OnHypertextLinkClicked | Raises the HypertextLinkClicked event. | |
| OnImageClicked | Raises the ImageClicked event. | |
| OnImageCreated | Raises the ImageCreated event. | |
| OnImageDeleted | Raises the ImageDeleted event. | |
| OnImageDoubleClicked | Raises the ImageDoubleClicked event. | |
| OnImageMoved | Raises the ImageMoved event. | |
| OnImageRightClicked | Raises the ImageRightClicked event. | |
| OnImageSized | Raises the ImageSized event. | |
| OnInputFormattingStyleChanged | Raises the InputFormattingStyleChanged event. | |
| OnInputParagraphChanged | Raises the InputParagraphChanged event. | |
| OnInputPositionChanged | Raises the InputPositionChanged event. | |
| OnPageChanged | Raises the PageChanged event. | |
| OnPageFormatChanged | Raises the PageFormatChanged event. | |
| OnParagraphFormatChanged | Raises the ParagraphFormatChanged event. | |
| OnSectionChanged | Raises the SectionChanged event. | |
| OnSpellCheckText | Raises the SpellCheckText event. | |
| OnTableCreated | Raises the TableCreated event. | |
| OnTableDeleted | Raises the TableDeleted event. | |
| OnTableFormatChanged | Raises the TableFormatChanged event. | |
| OnTextFieldChanged | Raises the TextFieldChanged event. | |
| OnTextFieldClicked | Raises the TextFieldClicked event. | |
| OnTextFieldCreated | Raises the TextFieldCreated event. | |
| OnTextFieldDeleted | Raises the TextFieldDeleted event. | |
| OnTextFieldDoubleClicked | Raises the TextFieldDoubleClicked event. | |
| OnTextFieldEntered | Raises the TextFieldEntered event. | |
| OnTextFieldLeft | Raises the TextFieldLeft event. | |
| OnTextFrameActivated | Raises the TextFrameActivated event. | |
| OnTextFrameClicked | Raises the TextFrameClicked event. | |
| OnTextFrameCreated | Raises the TextFrameCreated event. | |
| OnTextFrameDeactivated | Raises the TextFrameDeactivated event. | |
| OnTextFrameDeleted | Raises the TextFrameDeleted event. | |
| OnTextFrameDoubleClicked | Raises the TextFrameDoubleClicked event. | |
| OnTextFrameMoved | Raises the TextFrameMoved event. | |
| OnTextFrameRightClicked | Raises the TextFrameRightClicked event. | |
| OnTextFrameSized | Raises the TextFrameSized event. | |
| OnVExpanded | Raises the VExpanded event. | |
| OnVScroll | Raises the VScroll event. | |
| OnVShrunk | Raises the VShrunk event. | |
| OnXmlInvalid | Raises the XmlInvalid event. | |
| OnXmlNotWellFormed | Raises the XmlNotWellFormed event. | |
| ParagraphFormatDialog | Invokes the built-in dialog box for setting the formatting attributes of a paragraph. | |
| Paste | Replaces the current selection in the Text Control with the contents of the Clipboard. | |
| Overloaded. Prints a Text Control document or a part of a document. | ||
| Redo | Redoes the last Text Control operation. | |
| Replace | Opens the built-in Replace dialog box. | |
| ResetContents | Deletes the entire contents of a Text Control. | |
| Save | Overloaded. Saves text in a certain format in a file, in a byte array or as a string. | |
| SectionFormatDialog | Invokes the built-in tabbed dialog box for setting section attributes. | |
| Select | Selects text within the Text Control. | |
| SelectAll | Selects all text in the Text Control. | |
| SpellCheckDialog | Invokes the built-in dialog box for correcting misspelled words. | |
| TabDialog | Invokes the built-in dialog box for setting tabs. | |
| TableFormatDialog | Invokes the built-in dialog box for setting formatting attributes of tables. | |
| TextFrameAttributesDialog | Invokes the built-in dialog box for setting attributes of text frames. | |
| Undo | Undoes the last edit operation in the Text Control. |
| Event | Description | |
| AdaptFont | Occurs for each font that must be adapted, because it is not supported. | |
| Changed | Indicates that the contents of a document have been changed. | |
| CharFormatChanged | Occurs when the character formatting attributes either of the selected characters or the current text input position have been changed. | |
| DocumentLinkClicked | Occurs when a text field has been clicked on that represents a link to a target in the document. | |
| FormattingStyleListChanged | Occurs after one or more formatting styles have been added or removed. | |
| HeaderFooterActivated | Occurs when a header or footer has been activated. | |
| HeaderFooterDeactivated | Occurs when a header or footer has been deactivated. | |
| HExpanded | Occurs when the Text Control has automatically expanded its size horizontally. The event handler receives an argument of type EventArgs containing data related to this event. | |
| HScroll | Occurs when the horizontal scroll position has been changed. | |
| HShrunk | Occurs when the Text Control has automatically shrunk its size horizontally. The event handler receives an argument of type EventArgs containing data related to this event. | |
| HypertextLinkClicked | Occurs when a text field has been clicked on that represents the source of a hypertext link. | |
| ImageClicked | Occurs when an image has been clicked on. | |
| ImageCreated | Occurs when a new image has been created. | |
| ImageDeleted | Occurs when an image has been deleted. | |
| ImageDoubleClicked | Occurs when an image has been doubleclicked on. | |
| ImageMoved | Occurs when an inserted image has been moved with the built-in mouse interface. | |
| ImageRightClicked | Occurs when an image has been clicked on with the right mouse button. | |
| ImageSized | Occurs when an inserted image has been sized with the built-in mouse interface. | |
| InputFormattingStyleChanged | Occurs after the text input position has been moved to a text part formatted with another style. | |
| InputParagraphChanged | Occurs when the text input position has been moved to another paragraph. | |
| InputPositionChanged | Occurs when the text input position has been changed. | |
| PageChanged | Occurs when the text input position has been moved to another page. | |
| PageFormatChanged | Occurs when the page format settings have been changed. | |
| ParagraphFormatChanged | Occurs when the formatting attributes of the selected paragraphs have been changed. | |
| SectionChanged | Occurs when the text input position has been moved to another section. | |
| SpellCheckText | Occurs, if the document's text has been altered and the spelling of the new text must be checked. | |
| TableCreated | Occurs after a table has been pasted from the clipboard or when a document is loaded containing tables. | |
| TableDeleted | Occurs after a table has been deleted. | |
| TableFormatChanged | Occurs when the design attributes of a selected table have been changed. | |
| TextFieldChanged | Occurs when the text of a text field has been changed. | |
| TextFieldClicked | Occurs when a text field has been clicked on. | |
| TextFieldCreated | Occurs when a text field has been pasted from the clipboard. | |
| TextFieldDeleted | Occurs when a text field has been deleted. | |
| TextFieldDoubleClicked | Occurs when a text field has been double-clicked on. | |
| TextFieldEntered | Occurs when the current input position has been moved to a position that belongs to a text field. | |
| TextFieldLeft | Occurs when the current input position has left a text field. | |
| TextFrameActivated | Occurs when a text frame has been activated. | |
| TextFrameClicked | Occurs when a text frame has been clicked on. | |
| TextFrameCreated | Occurs when a new text frame has been created. | |
| TextFrameDeactivated | Occurs when a text frame has been deactivated. | |
| TextFrameDeleted | Occurs when a text frame has been deleted. | |
| TextFrameDoubleClicked | Occurs when a text frame has been doubleclicked on. | |
| TextFrameMoved | Occurs when a text frame has been moved with the built-in mouse interface. | |
| TextFrameRightClicked | Occurs when a text frame has been clicked on with the right mouse button. | |
| TextFrameSized | Occurs when a text frame has been sized with the built-in mouse interface. | |
| VExpanded | Occurs when the Text Control has automatically expanded its size vertically. | |
| VScroll | Occurs when the vertical scroll position has been changed. | |
| VShrunk | Occurs when the Text Control has automatically shrunk its size vertically. | |
| XmlInvalid | Occurs when a loaded or changed XML document cannot be validated with the document type definition (DTD) referenced in the document. | |
| XmlNotWellFormed | Occurs when a loaded XML document is not well-formed. |