What's New in TX Text Control .NET for Windows Forms 24.0
Version 24.0 gave Windows Forms applications a ribbon: a RibbonForm main window, a Ribbon with an application menu and contextual tabs, and predefined tabs that cover the features of the TextControl. Colored paragraphs, user-defined document properties, zoom options, typed exceptions and a mail merge that reads JSON data came with it, together with dialog boxes and the DataSourceManager class for building mail merge templates.
Version 24.0 was released on November 30, 2016, as TX Text Control X14, 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 2, is dated June 13, 2017. The features below are the ones added since version 23.0.
Version 24.0 at a Glance
| Area | What is new |
|---|---|
| Ribbons | RibbonForm, Ribbon, predefined ribbon tabs, contextual tab groups, a quick access toolbar |
| Viewing and toolbars | Zooming to the whole page, the page width or the text width, read-only toolbars |
| Formatting | Colored paragraph backgrounds and frame lines, new InputFormat properties, paper sizes of the printer |
| Documents | User-defined document properties, encrypted PDF import, typed exceptions |
| Text fields | Text fields of several types in document order |
| Mail merge | JSON data, the template location in merge events, DataSourceManager and dialog boxes for merge blocks and data sources |
Windows Forms Ribbon Controls
The class library received the controls to build a Windows Forms application with a ribbon instead of a menu and toolbars. See Built-in Ribbon Tabs.
- The main window. The form inherits from RibbonForm, which draws the quick access toolbar and the contextual tabs in its border. SetQuickAccessToolbarStandardItems sets the standard items of the quick access toolbar; users add and remove further items through a context menu.
- The ribbon. A Ribbon docked at the top of the window has the application menu as its first tab, filled through ApplicationMenuItems, and arranges the commands of the application in RibbonTab controls. The tabs hold groups of buttons, split buttons, toggle buttons, combo boxes, text boxes and list views. TextControl.Ribbon connects the
TextControlwith the ribbon. - Contextual tabs. Tabs that are only relevant in a particular context are grouped and added to the ContextualTabGroupCollection that Ribbon.ContextualTabGroups returns.
- Predefined tabs. RibbonFormattingTab and RibbonInsertTab cover the general editing features. RibbonPageLayoutTab edits the page setup, RibbonFrameLayoutTab images, text frames, drawings, barcodes and charts, and RibbonTableLayoutTab tables. RibbonProofingTab sets spelling, hyphenation and language options, RibbonViewTab the view settings, and RibbonReportingTab adds mail merge and reporting. The
FindItemmethod of each tab returns one of its items, so that an application can change or hide it. - Appearance and read-only mode. Ribbon.DisplayColors sets the colors of the tabs and the application menu. A ribbon with ReadOnly set to
truestill shows the formatting attributes of the connectedTextControl, but they can't be changed.
Custom Tabs and Commands adds tabs and groups of your own.
Viewing and Toolbars
- Zoom options. TextControl.Zoom zooms the content so that the whole page, the width of the page or the complete text of a line is visible, selected with the new ZoomOption enumeration. The StatusBar received two buttons for these options. See Viewing, Zooming, and Navigation.
- Read-only toolbars. A ButtonBar or RulerBar with
ReadOnlyset totrueshows the formatting attributes of the connectedTextControlwithout letting the user change them. See Toolbars and Mini Toolbars. - Frame events. The
TextControlraises events for frames, the images, text frames and other objects placed in a document, such as FrameClicked, FrameSelected,FrameMovedandFrameSized. TextFrameAppearanceChanged occurs when the background, the transparency, the border or the inner margins of a text frame change.
Colored Paragraphs and Text Formatting
- Paragraph colors. ParagraphFormat.BackColor colors the background of a paragraph and ParagraphFormat.FrameLineColor the lines of its frame. The
InputFormatclass, the dialog box for paragraph attributes, the TX Text Control format and all filters support the colors. - InputFormat. TopAligned,
BottomAlignedandVerticallyCenteredset the vertical text alignment. FrameFillColor sets the background of table cells,FrameLineColorthe frame color and FrameLineWidth the width of frame lines. - Color dialogs. FrameFillColorDialog, FrameLineColorDialog and PageColorDialog open the built-in dialog boxes for these colors and the page color. LoadSettings.LoadDocumentBackColor and SaveSettings.SaveDocumentBackColor decide whether the background color of a document is loaded and saved.
- Styles. FormattingStyle.BaseStyle returns the style a style is based on, and Selection.RemoveInlineStyles removes inline styles from the selected text.
Paper Sizes
TextControl.GetSupportedPaperSizes returns the names and sizes of all paper sizes that are supported at the moment, as PaperSize objects. The list depends on the formatting device, set with TextControl.FormattingPrinter. See Sections, Pages, Headers, and Footers.
User-Defined Document Properties
SaveSettings.UserDefinedDocumentProperties takes a UserDefinedPropertyDictionary with properties of the types String, Boolean, Int32 and Double, which are saved with the document. The TX Text Control format, RTF, DOC and DOCX support them. After a document is loaded, LoadSettings.UserDefinedDocumentProperties returns them. See Document Properties.
Text Fields
IFormattedText.GetTextFields and TextControl.GetTextFields return the text fields of one or more field types. With several types, the fields are in the order in which they appear in the document. PageNumberFieldCollection.GetItem gets one page number field of a collection. See Fields, Hyperlinks, and Bookmarks.
PDF Import and Error Handling
- Encrypted PDF files. PDF import loads encrypted files. See Passwords and Access Permissions.
- Typed exceptions. A
TextControlthrows a TextEditorException when an error occurs while text is edited and a FilterException, with its Reason, when a document can't be converted from or to another format. A LicenseLevelException means that the licensed product level doesn't contain a feature. - Standard exceptions. A parameter or property value that is wrong raises an
ArgumentException, anArgumentNullExceptionor anArgumentOutOfRangeException, and a call that is invalid in the object's current state anInvalidOperationException.
Mail Merge
MailMerge creates documents from a template and data.
- JSON data. MailMerge.MergeJsonData merges a JSON string with a single object or an array of objects with the same structure. See JSON and XML.
- Where an event occurred. Most events of a merge run tell where in the template they occurred: FieldMergedEventArgs,
ImageMergedEventArgsandImageFieldMergedEventArgsreceivedMergeBlockName,NestingDepthand, depending on the class,TableCellandDataRow. See Merge Events. - Data source information. DataSourceManager handles the supported kinds of data, from data sets and data tables to JSON, XML, objects and assemblies, describes their tables, columns and relations, inserts merge block templates and merges. The classes
DataTableInfo,DataColumnInfo,DataRelationInfo,MergeBlockInfoandMergeBlockSettingscame with it, and RibbonReportingTab.DataSourceManager gives the reporting tab its data. - Merge block names. MailMerge.MergeBlockNamePrefix returns the prefix
txmb_of internal merge block names, and LoadSaveSettingsBase.ReportingMergeBlockFormat sets how merge blocks are saved in a document.
Dialog Boxes for Templates
The new namespace DocumentServer.Windows.Forms holds modal dialog boxes, each shown with its ShowDialog method:
| Dialog box | Lets the user |
|---|---|
| InsertMergeBlockDialog | Design a merge block based on the current data source and insert it |
| EditMergeBlocksDialog | Remove or rename the merge blocks of the document |
| DatabaseConnectionDialog | Build a connection string and connect to a data source |
| EditDataRelationsDialog | Add data relations to the data source or remove them |
| DataSourceExtractionDialog | Save an excerpt of the loaded data source |
Reporting Ribbon and Dialog Boxes describes the reporting tab and its dialog boxes today.
Upgrade to Version 24.0
- Update notes. DrawingFrame.Refresh received an overload that refreshes part of a drawing. MailMerge.MergeObjects also merges collections of
System.Collections.Generic.Dictionaryobjects with string keys. BarcodeLayoutDialog, DrawingLayoutDialog, ImageAttributesDialog and TextFrameAttributesDialog ofTextControlreceived overloads that select the tab shown when the dialog box opens. - Breaking changes. No change of version 24.0 for Windows Forms 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 24.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 also names classes that existed before, such as ParagraphFormat, as it appears in that documentation.
New Classes
- DocumentServer.DataSources.DataColumnInfo
- DocumentServer.DataSources.DataColumnInfoCollection
- DocumentServer.DataSources.DataRelationInfo
- DocumentServer.DataSources.DataRelationInfoCollection
- DocumentServer.DataSources.DataSourceManager
- DocumentServer.DataSources.DataTableInfo
- DocumentServer.DataSources.DataTableInfoCollection
- DocumentServer.DataSources.MergeBlockInfo
- DocumentServer.DataSources.MergeBlockSettings
- DocumentServer.Json.InvalidCodePointException
- DocumentServer.Json.InvalidNumberFormatException
- DocumentServer.Json.ParserException
- DocumentServer.Json.UnexpectedEndOfInputException
- DocumentServer.Json.UnexpectedTokenException
- DocumentServer.Json.UnknownLiteralNameTokenException
- DocumentServer.Json.UnknownParseErrorException
- DocumentServer.Windows.Forms.DatabaseConnectionDialog
- DocumentServer.Windows.Forms.DataSourceExtractionDialog
- DocumentServer.Windows.Forms.EditDataRelationsDialog
- DocumentServer.Windows.Forms.EditMergeBlocksDialog
- DocumentServer.Windows.Forms.InsertMergeBlockDialog
- Drawing.ViewChangedEventArgs
- FilterException
- FrameEventArgs
- LicenseLevelException
- PaperSize
- ParagraphFormat
- TextEditorException
- UserDefinedPropertyDictionary
- Windows.Forms.Ribbon.ContextualTabGroup
- Windows.Forms.Ribbon.ContextualTabGroupCollection
- Windows.Forms.Ribbon.DialogBoxLauncher
- Windows.Forms.Ribbon.HorizontalRibbonGroup
- Windows.Forms.Ribbon.Ribbon
- Windows.Forms.Ribbon.Ribbon.Colors
- Windows.Forms.Ribbon.RibbonButton
- Windows.Forms.Ribbon.RibbonComboBox
- Windows.Forms.Ribbon.RibbonForm
- Windows.Forms.Ribbon.RibbonFormattingTab
- Windows.Forms.Ribbon.RibbonFrameLayoutTab
- Windows.Forms.Ribbon.RibbonGroup
- Windows.Forms.Ribbon.RibbonGroupCollection
- Windows.Forms.Ribbon.RibbonInsertTab
- Windows.Forms.Ribbon.RibbonItemCollection
- Windows.Forms.Ribbon.RibbonLabel
- Windows.Forms.Ribbon.RibbonListView
- Windows.Forms.Ribbon.RibbonListView.RibbonListViewItem
- Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemCollection
- Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemEventArgs
- Windows.Forms.Ribbon.RibbonMenuButton
- Windows.Forms.Ribbon.RibbonPageLayoutTab
- Windows.Forms.Ribbon.RibbonProofingTab
- Windows.Forms.Ribbon.RibbonReportingTab
- Windows.Forms.Ribbon.RibbonSeperator
- Windows.Forms.Ribbon.RibbonSplitButton
- Windows.Forms.Ribbon.RibbonTab
- Windows.Forms.Ribbon.RibbonTableLayoutTab
- Windows.Forms.Ribbon.RibbonTextBox
- Windows.Forms.Ribbon.RibbonToggleButton
- Windows.Forms.Ribbon.RibbonToolTip
- Windows.Forms.Ribbon.RibbonViewTab
.NET Members by Class
Next Steps
- Version 25.0: the features of the next version.
- Version 23.0: the features of the previous version.
- Older Versions: all versions from 29.0 back to 10.1.
- TX Text Control X14 for Windows Forms, WPF, ASP.NET and ActiveX Released: the release announcement on the Text Control Blog.