TX Text Control .NET for WPF

InputFormat Class

Class|Introduced in 16.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

The InputFormat class represents all formatting attributes at the current text input position. All properties are automatically updated, when the input position changes so that the class can be used in a XAML data binding without code behind. This is useful when a TextControl or WPF.TextControl is connected with other controls which show the current state at the input position. If text is selected and the selection has no common value for a certain attribute, the corresponding property is null.

Syntax

public class InputFormat

Examples

The following example changes the formatting applied to text entered at the end of a document.

textControl.Text = "Project summary";
textControl.InputPosition = new InputPosition(textControl.Text.Length);
InputFormat inputFormat = textControl.InputFormat;

Members

Properties

PropertyDescription
AllFrameLinesGets or sets a value specifying whether all frame lines, including all inner frame lines, are set for the selected text. If text is selected, the property specifies this attribute for the whole selected text.
BoldGets or sets a value specifying whether text is bold at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
BottomAlignedGets or sets a value specifying whether text is bottom aligned at the current input position. If text is selected, the property specifies this attribute for the whole selected text. In table cells text can be vertically aligned, at the top, at the bottom and centered. Outside of table cells, the vertical alignment is always at the top.
BottomDistanceGets or sets a bottom paragraph distance, in twips, at the current input position. If text is selected, the property specifies the bottom distance of the whole selected text.
BottomFrameLineGets or sets a value specifying whether there is a frame line at the bottom of the text. If text is selected, the property specifies this attribute for the whole selected text.
BoxFrameGets or sets a value specifying whether there is a complete frame around the text. If text is selected, the property specifies this attribute for the whole selected text.
BulletCharacterGets or sets the bullet character at the current input position. If text is selected, the property specifies the bullet character of the whole selected text.
BulletedListGets or sets a value specifying whether there is a bulleted list at the current input position. The bullet character is determined through the BulletCharacter property. If text is selected, the property specifies this attribute for the whole selected text.
CenteredGets or sets a value specifying whether text is centered at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
FontFamilyGets or sets the font family at the current input position. If text is selected, the property specifies the font family of the whole selected text.
FontSizeGets or sets the font's size, in twips, at the current input position. If text is selected, the property specifies the font size of the whole selected text.
FrameFillColorGets or sets the color used to display the frame fill color at the current input position. If text is selected, the property specifies the fill color of the whole selected text. A background color can be set for table cells and paragraphs. If the fill color is transparent, a TextControl uses the control's background color.
FrameLineColorGets or sets the color used to display the color of frame lines at the current text input position. If text is selected, the property specifies the color of frame lines used in the whole selected text. A frame line color can be set for table cells and paragraphs.
FrameLineWidthGets or sets the line width, in twips, of the paragraph's or table's frame at the current input position. If text is selected, the property specifies the line width of the whole selected text.
HangingIndentGets or sets the hanging indent, in twips, at the current input position. If text is selected, the property specifies the hanging indent of the whole selected text. A negative value indicates an additional indent of the paragraph's first line.
InnerHorizontalFrameLinesGets or sets a value specifying whether all inner horizontal frame lines are set for the selected text. This can be either table frame lines or lines between paragraphs.
InnerVerticalFrameLinesGets or sets a value specifying whether all inner vertical frame lines are set for the selected text. If the selected text contains no table, this property has no meaning.
ItalicGets or sets a value specifying whether the text is italic at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
JustifiedGets or sets a value specifying whether text is justified at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
LeftAlignedGets or sets a value specifying whether text is left aligned at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
LeftFrameLineGets or sets a value specifying whether there is a frame line at the left side of the text. If text is selected, the property specifies this attribute for the whole selected text.
LeftIndentGets or sets the left indent, in twips, at the current input position. If text is selected, the property specifies the left indent of the whole selected text.
LeftToRightGets or sets a value specifying whether the writung direction is left-to-right at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
LineSpacingGets or sets the line spacing, in percent, at the current input position. If text is selected, the property specifies the line spacing of the whole selected text.
NumberedListGets or sets a value specifying whether there is a numbered list at the current input position. The number format is determined through the NumberedListFormat property. If text is selected, the property specifies this attribute for the whole selected text.
NumberedListFormatGets or sets the number format for a numbered list at the current input position. If text is selected, the property specifies this attribute for the whole selected text. This property determines the number format for the NumberedList property. The property's value is a member of the NumberFormat enumeration.
NumberFormatGets or sets a number format which can be used to automatically format numbers in table cells. When a formula is defined the automatically calculated text can also be formatted with a number format. When a number format is not defined, the property's value is an empty string. The number format string has a format as described in Office Open XML File Formats - ISO/IEC 29500 - 1, Chapter: 18.8.31 Number Formats. See Formatting Text by using Number Formats for more information. If text is selected, the property specifies the number format of the whole selected text.
NumberFormatsReturns an array of all supported number formats for numbered and structured lists. This property can be used to fill a combo box or a menu.
NumberTextTypeGets or sets a value specifying whether text at the current input position is interpreted as a number which means that the period character (.) is defined as decimal separator and the comma character (,) is defined as thousands separator. This texttype can be used only in table cells. If text is selected, the property specifies this attribute for the whole selected text.
RightAlignedGets or sets a value specifying whether text is right aligned at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
RightFrameLineGets or sets a value specifying whether there is a frame line at the right side of the text. If text is selected, the property specifies this attribute for the whole selected text.
RightIndentGets or sets the right indent, in twips, at the current input position. If text is selected, the property specifies the right indent of the whole selected text.
RightToLeftGets or sets a value specifying whether the writing direction is right-to-left at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
StandardTextTypeGets or sets a value specifying whether the text at the current input position is interpreted as standard text which means that it is displayed as it is. The NumberTextType can be used when text in a table cell should be interpreted as a number. If text is selected, the property specifies this attribute for the whole selected text.
StrikeoutGets or sets a value specifying whether the text is strikeout at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
StructuredListGets or sets a value specifying whether there is a structured list at the current input position. The number format is determined through the StructuredListFormat property. If text is selected, the property specifies this attribute for the whole selected text.
StructuredListFormatGets or sets the number format for a structured list at the current input position. If text is selected, the property specifies this attribute for the whole selected text. This property determines the number format for the StructuredList property. The property's value is a member of the NumberFormat enumeration.
StructureLevelGets or sets the structure level of all selected paragraphs. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.
StyleNameGets or sets the formatting style name at the current input position. If text is selected, the property specifies the style of the whole selected text.
StyleNamesReturns an array of the names of all formatting styles, the document contains. This property can be used to fill a combo box or a menu.
SubscriptGets or sets a value specifying whether text is subscript at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
SuperscriptGets or sets a value specifying whether text is superscript at the current input position. If text is selected, the property specifies this attribute for the whole selected text.
TextBackColorGets or sets the color used to display the text background color at the current input position. If text is selected, the property specifies the background color of the whole selected text.
TextColorReturns or sets the color used to display the text at the current input position. If text is selected, the property specifies the text color of the whole selected text.
TopAlignedGets or sets a value specifying whether text is top aligned at the current input position. If text is selected, the property specifies this attribute for the whole selected text. In table cells text can be vertically aligned, at the top, at the bottom and centered. Outside of table cells, the vertical alignment is always at the top.
TopDistanceGets or sets a top paragraph distance, in twips, at the current input position. If text is selected, the property specifies the top distance of the whole selected text.
TopFrameLineGets or sets a value specifying whether there is a frame line at the top of the text. If text is selected, the property specifies this attribute for the whole selected text.
UnderlineGets or sets a value specifying whether text is underlined at the current input position. The underlining style is determined through the UnderlineStyle property. If text is selected, the property specifies this attribute for the whole selected text.
UnderlineStyleGets or sets the underline style at the current input position. If text is selected, the property specifies this attribute for the whole selected text. This property determines the style for the Underline property.
UnderlineStylesReturns an array of all supported underline styles. This property can be used to fill a combo box or a menu.
VerticallyCenteredGets or sets a value specifying whether text is vertically centered at the current text input position. If text is selected, the property specifies this attribute for the whole selected text. In table cells text can be vertically aligned, at the top, at the bottom and centered. Outside of table cells, the vertical alignment is always at the top.

Methods

MethodDescription
GetFontFamiliesReturns an array of strings specifying all supported fonts. These fonts depend on the formatting device set with the WPF.TextControl.FormattingPrinter or TextControl.FormattingPrinter property and on attributes set with the WPF.TextControl.FontSettings or TextControl.FontSettings property.
GetFontSizesReturns all possible font sizes of a certain font.

Events

EventDescription
AllFrameLinesChangedNot described in the reference. public event EventHandler AllFrameLinesChanged;
BoldChangedNot described in the reference. public event EventHandler BoldChanged;
BottomAlignedChangedNot described in the reference. public event EventHandler BottomAlignedChanged;
BottomDistanceChangedNot described in the reference. public event EventHandler BottomDistanceChanged;
BottomFrameLineChangedNot described in the reference. public event EventHandler BottomFrameLineChanged;
BoxFrameChangedNot described in the reference. public event EventHandler BoxFrameChanged;
BulletCharacterChangedNot described in the reference. public event EventHandler BulletCharacterChanged;
BulletedListChangedNot described in the reference. public event EventHandler BulletedListChanged;
CenteredChangedNot described in the reference. public event EventHandler CenteredChanged;
FontFamilyChangedNot described in the reference. public event EventHandler FontFamilyChanged;
FontSizeChangedNot described in the reference. public event EventHandler FontSizeChanged;
FrameFillColorChangedNot described in the reference. public event EventHandler FrameFillColorChanged;
FrameLineColorChangedNot described in the reference. public event EventHandler FrameLineColorChanged;
FrameLineWidthChangedNot described in the reference. public event EventHandler FrameLineWidthChanged;
HangingIndentChangedNot described in the reference. public event EventHandler HangingIndentChanged;
InnerHorizontalFrameLinesChangedNot described in the reference. public event EventHandler InnerHorizontalFrameLinesChanged;
InnerVerticalFrameLinesChangedNot described in the reference. public event EventHandler InnerVerticalFrameLinesChanged;
ItalicChangedNot described in the reference. public event EventHandler ItalicChanged;
JustifiedChangedNot described in the reference. public event EventHandler JustifiedChanged;
LeftAlignedChangedNot described in the reference. public event EventHandler LeftAlignedChanged;
LeftFrameLineChangedNot described in the reference. public event EventHandler LeftFrameLineChanged;
LeftIndentChangedNot described in the reference. public event EventHandler LeftIndentChanged;
LeftToRightChangedNot described in the reference. public event EventHandler LeftToRightChanged;
LineSpacingChangedNot described in the reference. public event EventHandler LineSpacingChanged;
NumberedListChangedNot described in the reference. public event EventHandler NumberedListChanged;
NumberedListFormatChangedNot described in the reference. public event EventHandler NumberedListFormatChanged;
NumberFormatChangedNot described in the reference. public event EventHandler NumberFormatChanged;
NumberTextTypeChangedNot described in the reference. public event EventHandler NumberTextTypeChanged;
RightAlignedChangedNot described in the reference. public event EventHandler RightAlignedChanged;
RightFrameLineChangedNot described in the reference. public event EventHandler RightFrameLineChanged;
RightIndentChangedNot described in the reference. public event EventHandler RightIndentChanged;
RightToLeftChangedNot described in the reference. public event EventHandler RightToLeftChanged;
StandardTextTypeChangedNot described in the reference. public event EventHandler StandardTextTypeChanged;
StrikeoutChangedNot described in the reference. public event EventHandler StrikeoutChanged;
StructuredListChangedNot described in the reference. public event EventHandler StructuredListChanged;
StructuredListFormatChangedNot described in the reference. public event EventHandler StructuredListFormatChanged;
StructureLevelChangedNot described in the reference. public event EventHandler StructureLevelChanged;
StyleNameChangedNot described in the reference. public event EventHandler StyleNameChanged;
StyleNamesChangedNot described in the reference. public event EventHandler StyleNamesChanged;
SubscriptChangedNot described in the reference. public event EventHandler SubscriptChanged;
SuperscriptChangedNot described in the reference. public event EventHandler SuperscriptChanged;
TextBackColorChangedNot described in the reference. public event EventHandler TextBackColorChanged;
TextColorChangedNot described in the reference. public event EventHandler TextColorChanged;
TopAlignedChangedNot described in the reference. public event EventHandler TopAlignedChanged;
TopDistanceChangedNot described in the reference. public event EventHandler TopDistanceChanged;
TopFrameLineChangedNot described in the reference. public event EventHandler TopFrameLineChanged;
UnderlineChangedNot described in the reference. public event EventHandler UnderlineChanged;
UnderlineStyleChangedNot described in the reference. public event EventHandler UnderlineStyleChanged;
VerticallyCenteredChangedNot described in the reference. public event EventHandler VerticallyCenteredChanged;