What's New in TX Text Control .NET for Windows Forms 23.0
Drawings made of MS Word shapes, which users edit directly in the document, and a set of new dialog boxes for hyperlinks, bookmarks, symbols and navigation are the Windows Forms additions of version 23.0. The same version introduced subtext parts, saved document properties such as the author with every format and changed how merge blocks are stored in mail merge templates.
Version 23.0 was released on December 9, 2015, as TX Text Control X13, together with TX Text Control .NET Server, TX Text Control .NET for WPF and TX Text Control ActiveX. Its last full installer, that of Service Pack 1, is dated August 8, 2016. The features below are the ones added since version 22.0.
Version 23.0 at a Glance
| Area | What is new |
|---|---|
| Drawings | Drawings and preset shapes compatible with MS Word, the TXDrawingControl, a layout dialog box |
| Dialog boxes | Hyperlinks, bookmarks, deleting bookmarks, go to, symbols, an extended list format dialog box |
| Formatted text | Subtext parts, collections for all text parts, symbol characters, Unicode bullets |
| Editing | User-defined undo steps, frames drawn with the mouse |
| Documents | Author, dates, keywords and subject saved with every format |
| Mail merge | Merge blocks as subtext parts, MergeObject, the BlockMerging event |
Drawings and Shapes
TX Text Control supports drawings and the preset shapes of ISO/IEC 29500-1, section 20.1.10.55. A drawing is a single shape or a canvas with several shapes. See Text Frames and Shapes.
- Positioning. A DrawingFrame positions the drawing like an image or a text frame: as a single character, anchored to a paragraph or at a fixed position in the document.
- The drawing control. Each drawing frame has a Drawing.TXDrawingControl, returned by DrawingFrame.Drawing, which holds the appearance and the data of the drawing. Its shapes are in a Drawing.ShapeCollection.
- Editing. Users activate a drawing and change its shapes with built-in mouse and keyboard interfaces. The Drawing.ShapesContextMenuStrip class is the context menu of the shapes.
- The collection. TextControl.Drawings returns the DrawingCollection, which adds and removes drawings. DrawingCreated,
DrawingDeletedand further events of theTextControlreport what happens to a drawing. - Layout dialog box. TextControl.DrawingLayoutDialog opens a dialog box for the position, the size and the distances to the text.
- File formats. Drawings are saved and loaded with the TX Text Control format and DOCX. Other formats save the drawing's image.
New Dialog Boxes
Version 23.0 added built-in Windows Forms dialog boxes for links, bookmarks and navigation. See Built-in Dialog Boxes.
- Hyperlinks. The HyperlinkDialog inserts a HypertextLink to an external location or a DocumentLink to a position in the same document. At a link, it shows the link's data for editing or deletion.
- Bookmarks. The BookmarkDialog inserts a bookmark at the input position or edits the name of the bookmark there. The DeleteBookmarksDialog lists all bookmarks of the document; the user jumps to one or deletes one or more.
- Go to. The GotoDialog moves the input position to a page, section, line, table or bookmark and marks the new position.
- Symbols. TextControl.AddSymbolDialog opens a dialog box that inserts a symbol character.
Fields, Hyperlinks, and Bookmarks describes links and bookmarks.
Subtext Parts
The main text, text frames, headers and footers are the text parts of a document. A SubTextPart is a smaller piece of text that you define to work on it separately. See Subtext Parts.
- Defining one. A subtext part is defined by a start position and a length or by a selection. TextControl.SubTextParts returns the SubTextPartCollection of the main text, which adds and removes subtext parts; text frames, headers and footers have their own.
- Name, ID and highlighting. A subtext part has a name and an ID. It is highlighted always or only while it contains the input position, set with HighlightMode.
- Nesting. Subtext parts can contain other subtext parts, but they can't overlap.
- Saving. SubTextPart.Save saves the content to a byte array or a string, in every format TX Text Control supports.
- Events. SubTextPartEntered,
SubTextPartLeft,SubTextPartClickedandSubTextPartDoubleClickedoccur on theTextControl.
Formatted Text
- Collections for all text parts. Document links, document targets, frames, charts, barcodes and drawings are available in every text part: the main text, headers, footers and text frames. IFormattedText.Drawings and HeaderFooter.Drawings are two of the new properties.
- Symbol characters. TextCharCollection.Add received overloads that add symbol and control characters in code.
- Bullets. The bullet of a list is no longer limited to the Windows Symbol font. ListFormat.FontName sets its font, and ListFormat.BulletCharacter can be any Unicode character. The dialog box of TextControl.ListFormatDialog received fields for both. See Bullets and Numbered Lists.
Editing
- Undo steps. TextControl.BeginUndoAction and EndUndoAction group all editing and formatting changes between them into one step that is undone and redone at once. UndoActionName returns the name you give it. See Undo and Redo.
- Inserting frames with the mouse. New overloads of TextFrameCollection.Add, BarcodeCollection.Add and DrawingCollection.Add take a frame and a FrameInsertionMode value. The user then draws the frame in the document with the mouse, and the object is inserted when the mouse button is released.
Document Properties
General document properties are saved with every supported format: SaveSettings.Author, CreationDate, CreatorApplication, DocumentKeywords, DocumentSubject and LastModificationDate. After a document is loaded, the properties of the same names of LoadSettings, such as LoadSettings.Author, return them. See Document Properties.
Mail Merge
MailMerge creates documents from a template and data.
- Merge blocks as subtext parts. Merge blocks, the sections of a template that are repeated for each record, are stored as subtext parts instead of document targets. Templates with blocks in the old format still load. See Merge Blocks.
- A single object. MailMerge.MergeObject merges one object. Before, a single record of object data had to be wrapped in an enumerable type such as an array or a list. See Objects and Collections.
- Empty blocks and images. RemoveEmptyBlocks and RemoveEmptyImages remove the content of merge blocks and the images for which there is no merge data. See Conditional Content.
- The data of a merge block. The BlockMerging event occurs before a merge block is merged. Its BlockMergingEventArgs contain the name of the block, the column names of its table and, in BlockData, its data. See Merge Events.
- Data adapters. The interfaces IDataTableAdapter and IDataRowAdapter describe the tables and rows of this data: table name, column names, child tables, rows and child rows.
Upgrade to Version 23.0
- Merge block format. Templates created with version 23.0 store merge blocks as subtext parts. Templates with blocks in the old format, based on document targets, still load.
- Update notes.
TextFrameCollection.AddandBarcodeCollection.Addreceived the overloads for inserting a frame with the mouse. - Obsolete members.
ListFormat.CharAfterNumberandCharBeforeNumber, which the list of version 23.0 names, are obsolete today; Deprecated APIs names their replacements. - Other breaking changes. Breaking Changes starts with version 30.0.
New Classes, Properties, Methods and Events
These are the classes and members that the What's New documentation of version 23.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 the members that are obsolete today. The list includes the members of ServerTextControl, the document processing class without a user interface that is part of this product too, and it also names classes that existed before, such as SaveSettings and ListFormat, as it appears in that documentation. The reference marks the Charts property of FootnoteSection and FootnoteText as introduced in version 23.0, but both classes came with footnotes in version 32.0, so they are left out here.
New Classes
- BookmarkDialog
- DataVisualization.DrawingCollection
- DataVisualization.DrawingEventArgs
- DataVisualization.DrawingFrame
- DeleteBookmarksDialog
- DocumentServer.MailMerge.BlockMergingEventArgs
- Drawing.MenuItem
- Drawing.Selection
- Drawing.Shape
- Drawing.Shape.Fill
- Drawing.Shape.Outline
- Drawing.ShapeCollection
- Drawing.ShapeEventArgs
- Drawing.ShapesContextMenuStrip
- Drawing.TXDrawingControl
- GotoDialog
- HyperlinkDialog
- ListFormat
- SaveSettings
- SubTextPart
- SubTextPartCollection
- SubTextPartEventArgs
.NET Members by Class
Next Steps
- Version 24.0: the features of the next version.
- Version 22.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X13 for Windows Forms, WPF, ASP.NET and ActiveX Released: the release announcement on the Text Control Blog.