What's New in TX Text Control .NET for Windows Forms 26.0
With version 26.0, a Windows Forms TextControl records who changed a document and lets users accept or reject each change, and the new Sidebar control offers find, replace, styles and tracked changes beside the text instead of in a dialog box. Tables learned to calculate with formulas loaded from Excel workbooks or set in code, and mail merge received filters, sorting and conditions for merge blocks, with a dialog box to edit them.
Version 26.0 was released on November 14, 2018, as TX Text Control X16, together with TX Text Control .NET Server, TX Text Control .NET for WPF, TX Text Control ActiveX and TX Barcode .NET 5.0. Its last full installer, that of Service Pack 1, is dated May 31, 2019. The features below are the ones added since version 25.0.
Version 26.0 at a Glance
| Area | What is new |
|---|---|
| Track changes | Tracked insertions and deletions per user, accepted or rejected in code or on the Proofing tab |
| User interface | The Sidebar control, a Track Changes ribbon group, the formula ribbon tab, key tips for all ribbon drop-down controls |
| Excel workbooks | Import of XLSX files, the SpreadsheetML format |
| Tables | Formulas in table cells, number formats, cell references in the ruler bars, new keyboard behavior |
| Mail merge | Removal of empty lines, conditions, filters and sorting for merge blocks, the Filter and Sort dialog box |
Track Changes
TextControl.IsTrackChangesEnabled switches track changes on and off. While it is on, the TextControl marks every new change; switching it off stops the marking, and changes marked before stay in the document until they are removed. See Track Changes.
- The changes. TextControl.TrackedChanges returns a TrackedChangeCollection; headers, footers and text frames have their own. A TrackedChange has a start, a length and a ChangeKind that tells inserted from deleted text.
- Accepting and rejecting. TrackedChangeCollection.Remove accepts or rejects a change, which is the only way to remove it from the document.
- Users and time. Each change has a ChangeTime and a UserName. A new change belongs to the first name in TextControl.UserNames; with an empty list, the user is unknown.
- On the screen. Inserted text appears in a color and deleted text in a color with a strikethrough. The color depends on the user; for the current user, it is red by default.
- Events. TrackedChangeCreated, TrackedChangeDeleted and TrackedChangeChanged report the changes of the collection.
- Changes that can't be tracked. Some complex operations, such as deleting a table column, can't be tracked. For them, the CannotTrackChange event occurs, and its CannotTrackChangeEventArgs let the application or the user decide whether the operation is carried out.
- File formats. Tracked changes are saved in and loaded from the TX Text Control format, RTF, DOC and DOCX.
The Sidebar Control
The Sidebar is a control that an application places next to the TextControl as an alternative to dialog boxes. Pinned, it is docked in the form; unpinned, it is shown as a dialog. It hosts a custom control or one of the predefined layouts that connect to a TextControl. See Sidebar and Panels.
Ribbon tabs can show and hide a horizontal and a vertical sidebar with a toggle button:
- Formatting tab. RibbonFormattingTab.FindSidebar and its siblings
FindHorizontalSidebar,GotoSidebar,GotoHorizontalSidebar,ReplaceSidebar,ReplaceHorizontalSidebarand StylesSidebar connect sidebars for finding, going to, replacing and styles. - Proofing tab. RibbonProofingTab.TrackedChangesSidebar and
TrackedChangesHorizontalSidebarconnect sidebars that list the tracked changes.
Ribbons
- Track Changes group. The RibbonProofingTab received a group with buttons that switch tracking on and off, accept and reject changes and move to the next or the previous change.
- Tables. The RibbonTableLayoutTab sets formulas and number formats of table cells, and the new RibbonFormulaTab is a ribbon tab for editing formulas.
- Key tips. All drop-down controls of a ribbon, the application menu included, have key tips.
- Form and application menu. RibbonForm.HasQuickAccessToolbar decides whether the caption of the form shows a quick access toolbar, and Ribbon.HasApplicationMenu whether the first tab of the ribbon is an application menu.
Built-in Ribbon Tabs describes the tabs of today's version.
Excel Workbooks
Besides WordprocessingML, TX Text Control reads SpreadsheetML, the part of Office Open XML that MS Excel uses for its XLSX files. Files and memory blocks in this format can be loaded, and the StreamType enumeration has a new value SpreadsheetML.
- One worksheet. The import takes the content of the first worksheet. LoadSettings.GetDocumentPartNames and LoadSettings.DocumentPartName, new in this version, list the parts of a SpreadsheetML document and choose the one to load.
- Limits. A formula with a reference to another worksheet or another file isn't supported.
Supported File Formats lists the formats of today's version.
Formulas and Number Formats in Tables
A formula lets a table cell calculate its content from other cells. It comes with a loaded SpreadsheetML document or is set in code, and a third tab of the table format dialog box, TextControl.TableFormatDialog, lets users set formulas and number formats. See Tables and Table Formulas and Tables and Calculations.
- Formulas. TableCell.Formula holds the formula of a cell. When an input cell changes, the result is recalculated; TextControl.IsFormulaCalculationEnabled switches this off. The result of one formula can feed another, but references to other tables or files aren't possible. TableCollection.SupportedFormulaFunctions returns the functions formulas can call.
- Reference styles. TextControl.FormulaReferenceStyle chooses the notation of cell references, A1 or R1C1, which Formula Syntax describes.
- Number formats. TableCellFormat.NumberFormat formats the result of a cell. Only positive number formats are supported, and TableCollection.SupportedNumberFormats returns them.
InputFormatreceived the matching propertiesNumberFormat,NumberTextTypeandStandardTextType. - Invalid input. A formula or number format that can't be parsed raises a FormulaException or a NumberFormatException, whose
CharacterIndexpoints to the first invalid character. - Ruler bars. RulerBar.FormulaMode shows cell references in the ruler bars, for all cells or for the cells with a formula only, in the notation of
FormulaReferenceStyle. See Rulers and Status Bar.
Keyboard Interface
Two keys behave differently since version 26.0. TAB in the last cell of a table adds a row at the end of the table. ENTER at the first input position of a document that begins with a table inserts an empty line above the table. Keyboard Shortcuts lists the keys of today's version.
Mail Merge
MailMerge creates documents from a template and data. In version 26.0, it gained settings for empty lines and for merge blocks, the parts of a template that are repeated for each record.
- Empty lines. With MailMerge.RemoveEmptyLines, lines that are empty once the data is merged are removed from the document.
- Conditions. MergeBlockInfo.BlockMergingCondition merges a block or leaves it out, depending on a column of the parent data row and a comparison such as "equal to", "greater than" or "is not blank".
- Filters and sorting. MergeBlockInfo.Filters holds FilterInstruction objects joined by "and" or "or", and MergeBlockInfo.SortingInstructions holds SortingInstruction objects that sort by one or more columns in ascending or descending order.
- The Filter and Sort dialog box. DocumentServer.Windows.Forms.FilterAndSortDialog creates filters and sorting instructions. An application opens it in code, or users open it with the new Filter and Sort buttons of the EditMergeBlocksDialog and the InsertMergeBlockDialog. StoreBlockMetaData writes the result into an existing merge block; a new block takes it through the
FiltersandSortingInstructionsproperties ofMergeBlockInfo.
See Conditional Content, Sorting and Filtering and Reporting Ribbon and Dialog Boxes.
Other API Additions
- Loading. LoadSettings is listed with properties such as
LoadImages,LoadHypertextLinks,ImageSearchPath,PageSizeandPageMargins; the table below names them all. - Saving. SaveSettings.OmittedContent is new.
- Subtext parts. SubTextPart.Data keeps additional data with a subtext part.
Upgrade to Version 26.0
- Update notes. No update notes were published for version 26.0.
- Breaking changes. No change of version 26.0 is known to break existing code. 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 26.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. The list includes the members of ServerTextControl, the document processing class without a user interface that is part of this product too, and it names classes that existed before, such as LoadSettings and TableCell, as that documentation does.
New Classes
- CannotTrackChangeEventArgs
- DocumentServer.DataShaping.FilterInstruction
- DocumentServer.DataShaping.SortingInstruction
- DocumentServer.Windows.Forms.FilterAndSortDialog
- FormulaException
- LoadSettings
- NumberFormatException
- TableCell
- TableCollection
- TrackedChange
- TrackedChangeCollection
- TrackedChangeEventArgs
- Windows.Forms.Ribbon.RibbonFormulaTab
- Windows.Forms.Sidebar
.NET Members by Class
Next Steps
- Version 27.0: the features of the next version.
- Version 25.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X16 and TX Barcode .NET 5.0 Released: the release announcement on the Text Control Blog.