TX Text Control .NET for Windows Forms

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

Topic

A TextControl that rescales itself when its window moves to a display with another scale factor, and tables of contents with their own dialog box and ribbon tab, are the Windows Forms additions of version 29.0. The version also brought the DocumentSettings class with a sidebar to edit it, files embedded in PDF documents, the DocumentServer.PDF namespace and barcodes as part of TX Text Control itself.

Version 29.0 was released on December 2, 2020, as TX Text Control X19, together with TX Text Control .NET Server, TX Text Control .NET for WPF, TX Text Control ActiveX and TX Spell .NET 8.0. Its last full installer, that of Service Pack 3, is dated July 21, 2021. The features below are the ones added since version 28.0; the next version is Version 30.0.

Version 29.0 at a Glance

AreaWhat is new
DisplayPer-monitor DPI awareness for the TextControl, its toolbars and ribbons
Document structureTables of contents generated from structure levels, with a dialog box and the RibbonReferencesTab
Document settingsThe DocumentSettings class and a sidebar that edits the settings, custom properties and embedded files
PDFEmbedded files, AcroForm import, text search in PDF documents
Mail mergeFilters and sorting instructions of existing merge blocks changed in code
RibbonsPosition of the quick access toolbar, a ribbon shown minimized at start
BarcodesTX Barcode .NET integrated into TX Text Control

Per-Monitor DPI Awareness

Since the Windows 10 Creators Update (version 1703), an application is drawn for the DPI of the display on which most of its main window is. With version 29.0, a TextControl supports setups with several displays of different scale factors: when the application moves from one display to another, or the scale factor changes while it runs, the TextControl and all its toolbars and ribbons change their scaling at once.

In the .NET Framework 4.7 and later, this high DPI support is opt-in and is switched on in the application's configuration file. The TX Words sample programs of this version contain such a configuration file. High DPI and Display Scaling shows the configuration for today's applications.

Tables of Contents

A table of contents is generated from the structure level of the paragraphs in a document. See Tables of Contents.

Document Settings

TextControl.DocumentSettings returns a DocumentSettings object with the general settings of the document the user works on: author, creation date, creator application, base path, keywords, subject, title, embedded files and user-defined properties. The values can be changed while the document is open. Save stores them with the document, and a property of SaveSettings with the same name overrides a value for one save. See Document Properties.

The Document Settings Sidebar

The Sidebar received a layout for the document settings, the value DocumentSettings of SidebarContentLayout. It shows the following settings:

  • Title, author, subject and keywords in text boxes the user edits.
  • The creation date, set to the current date when the content of the TextControl is reset, or the creation date of a loaded document.
  • Custom properties, the user-defined document properties. Add... opens the Add Custom Property dialog box, and Delete removes a property.
  • Embedded files in PDF. Add... opens a file dialog and sets a MIME type that fits the file extension; Edit... opens the Edit Embedded File dialog box for the MIME type, the relationship and the description; Save... saves an embedded file and Remove deletes it. The files are loaded only if LoadSettings.PDFImportSettings includes LoadEmbeddedFiles, and they are saved only in PDF documents.

Controls of the sidebar that an application doesn't need are hidden or removed through Sidebar.FindItem and the values of Sidebar.DocumentSettingsItem. Sidebar and Panels describes the sidebar and its layouts.

PDF Documents

Version 29.0 extended both directions of the PDF support: files can be embedded when a PDF is saved, and a new namespace reads data out of existing PDF documents.

Mail Merge

MailMerge creates documents from a template and data. Its repeating merge blocks, sections of the template that are repeated for each record, carry filter and sorting information since version 26.0, and version 29.0 made that information editable in code.

Sorting and Filtering describes filters and sorting instructions.

Subtext Parts

SubTextPart.GetChildren returns the subtext parts nested in a subtext part, and SubTextPart.GetTextFields the text fields it contains. See Subtext Parts.

Ribbons and Styles

  • Quick access toolbar. RibbonForm.QuickAccessToolbarPosition places the quick access toolbar above or below the ribbon.
  • Minimized ribbon. Ribbon.Minimized shows the ribbon minimized when the application starts.
  • Drop-down menus in list views. When the view mode of a RibbonListView includes ListViewMode.DropDown, each item shows a drop-down menu. The new RibbonListViewItemDropDown class holds its settings, and the events ItemDropDownOpening and ItemDropDownClosed report when it opens and closes.
  • Style changes. TextControl.FormattingStyleChanged occurs after the attributes of one or more formatting styles have changed.

Built-in Ribbon Tabs describes the ribbon of today's version.

Barcodes

The barcode component TX Barcode .NET became part of TX Text Control, so barcodes no longer need a separate product. Barcode.TXBarcodeControl creates a barcode. In a document, a barcode is a BarcodeFrame in a BarcodeCollection, positioned like an image or a text frame. The new Barcode.BarcodeTypeSettings class sets whether a barcode has a check value and whether it shows it. See Charts and Barcodes.

Upgrade to Version 29.0

  • Update notes. The update notes of version 29.0 list one entry: LoadSettings.PDFImportSettings was extended with the settings LoadEmbeddedFiles, LoadMetadata and GenerateXMLAsEmbeddedFile. Of the three, only LoadEmbeddedFiles is a value of the current PDFImportSettings enumeration. Today, the metadata, the form fields and the text coordinates of a PDF document come from LoadEmbeddedData and LoadSettings.EmbeddedData. The What's New documentation of version 30.0 repeats the same entry.
  • Breaking changes. No change of version 29.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 29.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.

New Classes

.NET Members by Class

ClassPropertiesMethodsEvents
Barcode.BarcodeTypeSettingsHasCheckValue, ShowCheckValue
Barcode.TXBarcodeControlAdditionalText, Alignment, Angle, BackColor, BarcodeType, BarcodeTypeSettings, ForeColor, ShowText, Text, TextAlignment, UpperTextLengthGetDefaultText, GetMaximumTextLength, GetMinimumTextLength, IsTextValid, Load, PrintPaint, Save, SaveImage
DocumentLinkAutoGenerationType, DocumentTarget
DocumentServer.DataSources.MergeBlockInfoMergeFieldsApply
DocumentServer.PDF.AcroForms.FormCheckBoxIsChecked
DocumentServer.PDF.AcroForms.FormChoiceFieldCanEdit, CommitOnSelChange, DoNotSpellCheck, MultiSelect, Options, Sort, Value
DocumentServer.PDF.AcroForms.FormFieldAlternateFieldName, Bounds, FieldName, FieldType
DocumentServer.PDF.AcroForms.FormTextFieldValue
DocumentServer.PDF.Contents.ContentLineHeight, Page, Rectangle, Text, Width, X, Y
DocumentServer.PDF.Contents.LinesContentLinesFind
DocumentServer.PDF.FormsGetAcroFormFields
DocumentSettingsAuthor, CreationDate, CreatorApplication, DocumentBasePath, DocumentKeywords, DocumentSubject, DocumentTitle, EmbeddedFiles, UserDefinedDocumentProperties
DocumentTargetAutoGenerationType, Deleteable, ID, Name, Start, TargetNameScrollTo
EmbeddedFileCreationDate, Data, Description, FileName, LastModificationDate, MIMEType, Relationship
HeaderFooterTablesOfContents
IFormattedTextTablesOfContents
InputFormatStructureLevel
LoadSaveSettingsBaseEmbeddedFiles
LoadSettingsEmbeddedData
ParagraphFormatStructureLevel, TabLeaders
ServerTextControlDocumentSettings, TablesOfContentsOnTableOfContentsCreated, OnTableOfContentsDeletedTableOfContentsCreated, TableOfContentsDeleted
SubTextPartGetChildren, GetTextFields
TableOfContentsDefaultHighlightColor, HasLinks, HasPageNumbers, HasRightAlignedPageNumbers, HighlightColor, HighlightMode, ID, Length, MaximumStructureLevel, MinimumStructureLevel, Name, Number, Start, Text, TitleSave, ScrollTo, Update
TableOfContentsCollectionCount, IsSynchronized, Item, SyncRootAdd, CopyTo, GetEnumerator, GetItem, Remove
TableOfContentsEventArgsTableOfContents
TextControlDocumentSettings, TablesOfContentsOnFormattingStyleChanged, OnTableOfContentsCreated, OnTableOfContentsDeleted, OnTableOfContentsEntered, OnTableOfContentsLeft, TableOfContentsDialogFormattingStyleChanged, TableOfContentsCreated, TableOfContentsDeleted, TableOfContentsEntered, TableOfContentsLeft
TextFrameTablesOfContents
Windows.Forms.Ribbon.RibbonMinimized
Windows.Forms.Ribbon.RibbonFormQuickAccessToolbarPosition
Windows.Forms.Ribbon.RibbonListViewMinColumnWidth, MinimumWidthItemDropDownClosed, ItemDropDownOpening
Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemDropDown
Windows.Forms.Ribbon.RibbonListView.RibbonListViewItemDropDownItems, MinimumWidth, SelectedIndex, SelectedItem, ShowCheckMargin, ShowText, Text
Windows.Forms.Ribbon.RibbonReferencesTabFindItem

Next Steps