TX Text Control .NET for Windows Forms

What's New in TX Text Control .NET for Windows Forms 16.0

Topic

TX Text Control .NET for Windows Forms 16.0 prepared the control for ribbon interfaces with the InputFormat class and opened the text of a document to a common interface: the main text, text frames and headers and footers became text parts with the same members. The version also added a spell checker interface, table headers that repeat on every page and nested merge blocks, and it changed several types and assemblies that code written for version 15.1 uses.

Version 16.0 was released in November 2010, as the blog article TX Text Control 16.0 Has Just Been Released announced. It was the first version with a WPF edition, TX Text Control .NET for WPF, whose controls in the TXTextControl.WPF namespace offer the feature set of the Windows Forms controls. The WPF controls aren't part of TX Text Control .NET for Windows Forms and aren't listed here.

Version 16.0 at a Glance

AreaWhat is new
Ribbon supportThe InputFormat class, indents and font sizes changed in steps
Browser applicationsThe Windows Forms TextControl in browser-based applications
Text partsTextPartCollection, the IFormattedText interface and the MainText class
Spell checkingAn interface for any spell checker, with the SpellCheckText event
TablesHeader rows that repeat on each page
Mail mergeNested merge blocks, image merge fields, access to the merged data
Page sizeThe PageSize class and a unit for page sizes and margins

Ribbon Support

User interfaces with a ribbon need the formatting at the input position to show the state of their buttons:

Built-in Ribbon Tabs describes the ribbon of the current version.

Browser Applications

The Windows Forms TextControl can be used in a browser-based application with the functionality it has in a Windows Forms application, including loading and saving files in every supported format on the client machine. The browser controls BrowserTextControl, BrowserButtonBar, BrowserRulerBar and BrowserStatusBar were therefore removed.

Text Parts

A document consists of its main text and further pieces of text: text frames and headers and footers.

  • All text parts. TextControl.TextParts returns a TextPartCollection with all text parts of the document in geometric order: first the main text, then the text frames, then the headers and footers. Activate moves the input position into a text part, and GetItem returns the active one.
  • One interface. Every text part implements IFormattedText, which provides its lines, paragraphs, characters, selection, tables, images, text fields, hypertext links, application fields and misspelled words, and a Find method. TextControl, ServerTextControl, TextFrame, HeaderFooter and MainText implement it.
  • Main text. A MainText object stands for the main text. Its collections always belong to the main text. The collections of the control, such as TextControl.Tables, belong to the text part that has the input focus.

Subtext Parts covers text parts and subtext parts in the current version.

Spell Checking

TX Text Control got an interface that connects any spell checker:

Spell Checking and Hyphenation covers spell checking in the current version.

Tables and Pages

  • Table headers. One or more rows marked with TableRow.IsHeader form the header of a table, which is repeated at the top of each page, or of each column, the table extends over. Users define the header in the table attributes dialog box. See Tables and Table Formulas.
  • Page size. A PageSize object with Width and Height describes the page size, and TextControl.PageUnit sets the unit of page sizes and page margins.

Mail Merge

Upgrade to Version 16.0

Version 16.0 changed types and assemblies. Code written for earlier versions has to be adapted:

  • Page margins. The properties Left, Top, Right and Bottom of PageMargins are of the type double instead of int.
  • Page size. TextControl.PageSize and ServerTextControl.PageSize are of the type PageSize instead of System.Drawing.Size.
  • Dialog results. The overloads of Selection.Load that open a dialog box return a Selection.DialogResult value instead of System.Windows.Forms.DialogResult.
  • Browser controls removed. The classes BrowserTextControl, BrowserButtonBar, BrowserRulerBar and BrowserStatusBar were removed. Replace them with TextControl, ButtonBar, RulerBar and StatusBar.
  • Assemblies. TXTextControl.dll was split into TXTextControl.dll and TXTextControl.Windows.Forms.dll.

New Classes, Properties, Methods and Events

The classes and members below are the ones that the What's New documentation of version 16.0 lists for TX Text Control .NET for Windows Forms. Names are relative to the TXTextControl namespace, each name links to its current reference page, and "(obsolete)" marks a member that is obsolete today.

New Classes

Members by Class

ClassPropertiesMethodsEvents
DocumentServer.MailMergeRemoveTrailingWhitespaceGetBlockNamesImageFieldMerged
DocumentServer.MailMerge.DataRowMergedEventArgsMergedRow
DocumentServer.MailMerge.FieldMergedEventArgsMergedField
DocumentServer.MailMerge.ImageFieldMergedEventArgsFieldName, Filename, Image, Merged
HeaderFooterHypertextLinks, MisspelledWordsFind
IFormattedTextApplicationFields, HypertextLinks, Images, Lines, MisspelledWords, Paragraphs, Selection, Tables, TextChars, TextFieldsFind
InputFormatAllFrameLines, Bold, BottomDistance, BottomFrameLine, BoxFrame, BulletCharacter, BulletedList, Centered, FontFamily, FontSize, HangingIndent, InnerHorizontalFrameLines, InnerVerticalFrameLines, Italic, Justified, LeftAligned, LeftFrameLine, LeftIndent, LineSpacing, NumberedList, NumberedListFormat, NumberFormats, RightAligned, RightFrameLine, RightIndent, Strikeout, StructuredList, StructuredListFormat, StyleName, StyleNames, Subscript, Superscript, TextBackColor, TextColor, TopDistance, TopFrameLine, Underline, UnderlineStyle, UnderlineStylesGetFontFamilies, GetFontSizes
MisspelledWordLength, Number, Start, TextSelect
MisspelledWordCollectionCount, ItemCopyTo, GetEnumerator, GetItem, Remove
PageSizeHeight, Width
SelectionDecreaseIndent, GrowFont, IncreaseIndent, ShrinkFont
ServerTextControlIsSpellCheckingEnabled, MisspelledWords, PageUnit, TextPartsOnSpellCheckTextSpellCheckText
SpellCheckTextEventArgsMisspelledWords, Text
TableRowIsHeader
TextControlInputFormat, IsSpellCheckingEnabled, MisspelledWords, PageUnit, TextPartsOnSpellCheckTextSpellCheckText
TextFieldIsSpellCheckingEnabled
TextFrameHypertextLinks, MisspelledWords
TextPartCollectionCountActivate, CopyTo, GetEnumerator, GetItem, GetMainText

Next Steps

  • Version 17.0: the features of the next version.
  • Version 15.1: drag and drop, display colors, the frame base class and document-wide image export.
  • Breaking Changes: the changes of the current versions that need work in an upgrade.