TX Text Control .NET for Windows Forms

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

Topic

Forms that users fill out in the TextControl arrived with version 28.0: four kinds of form fields, a ribbon tab to insert them and a rule engine, the conditional instructions, with its own dialog boxes and sidebar. The version also changed the class hierarchy of document targets, the bookmarks of a document, which can require changes to existing code.

Version 28.0 was released on March 16, 2020, as TX Text Control X18, together with TX Text Control .NET Server, TX Text Control .NET for WPF and TX Text Control ActiveX. The last full installer of version 28.0 is dated October 26, 2020, shortly after Service Pack 4. The features below are the ones added since version 27.0.

Version 28.0 at a Glance

AreaWhat is new
FormsCheck box, text, selection and date form fields, saved as TX, DOC, DOCX and RTF and exported as PDF form fields
Conditional instructionsRules that enable, validate or fill form fields depending on the values of other fields, managed in dialog boxes and a sidebar
RibbonsThe RibbonFormFieldsTab, keyboard selection in ribbon list views
Document targetsBookmarks at any position, several at one position, DocumentTarget no longer derived from TextField
Dialog boxesThe measuring unit of the built-in dialog boxes

Form Fields

Four new kinds of text fields let you design forms and let users fill them out. TextControl.FormFields returns the FormFieldCollection of the main text; headers, footers and text frames have their own, and ServerTextControl.FormFields gives the same access without a user interface. See Form Fields and Conditional Instructions for the editor and Forms and Conditional Instructions for document processing.

The Form Fields Ribbon Tab

The RibbonFormFieldsTab is a ribbon tab for inserting and editing form fields. It works with the TextControl connected to the ribbon that hosts it. ConditionalInstructionsSidebar and ConditionalInstructionsHorizontalSidebar connect the tab to the sidebars that show the conditional instructions. Built-in Ribbon Tabs describes the ribbon tabs of today's version.

Conditional Instructions

Conditional instructions are a rule engine for forms, which brings logic and workflows into a document. A ConditionalInstruction holds a list of Instruction objects that are executed when its Condition objects are met. FormFieldCollection.ConditionalInstructions returns the ConditionalInstructionCollection of a document.

  • Conditions. A condition is met when the value of its form field compares successfully with a required value.
  • Instructions. An instruction does one of four things to a form field: it changes FormField.Enabled, marks the value as valid or invalid, sets a new value or replaces the Items of a selection field.
  • Else values. An instruction can have an else value, which is applied when the conditions aren't met.
  • Dialog boxes. TextControl.ManageConditionalInstructionsDialog opens a dialog box that adds, edits and deletes the instructions of a document. ConditionalInstructionDialog opens the dialog box that creates or edits one instruction; it also opens from the Conditional Instructions sidebar.
  • Protected documents. TextControl.IsFormFieldValidationEnabled decides whether conditional instructions are applied when EditMode is ReadAndSelect and the document permissions make the document read-only. Its default value is false.

Form Fields and Conditional Instructions shows how to validate entries with conditional instructions, and Sidebar and Panels describes the sidebars.

Document Targets and Bookmarks

A DocumentTarget is a bookmark: a position in the document that a link can point to.

  • Any position. A document target can be inserted at any text position, including inside a text field and at its beginning or end, and several targets can share one position. The built-in BookmarkDialog lets users insert several bookmarks at the same input position as well.
  • No longer a text field. To make this possible, DocumentTarget no longer inherits from TextField. Members it used to inherit, such as the ID and ScrollTo, are now implemented by DocumentTarget itself, and inherited members that had no meaning for a target, such as Text and Editable, are gone.
  • Events. TextControl.DocumentTargetCreated and DocumentTargetDeleted pass a DocumentTargetEventArgs object. DocumentTargetCollection.GetItems is also new.
  • Text field events of ServerTextControl. TextFieldCreated and TextFieldDeleted of ServerTextControl occur when a text field is created or deleted.

Fields, Hyperlinks, and Bookmarks shows how to insert bookmarks.

Dialog Boxes and Ribbons

  • Measuring unit. TextControl.DialogUnit sets the unit of sizes and distances in the built-in dialog boxes. With Auto, the unit depends on the culture of the current thread; Centimeter, Inch and Millimeter set it explicitly. See Built-in Dialog Boxes.
  • Ribbon list views. RibbonListView.SelectWithArrowKeys decides whether an item chosen with the arrow keys is also selected, and EditItemTextBoxEmptyWidth sets the width of the edit box of an item without text.

Upgrade to Version 28.0

  • DocumentTarget no longer inherits from TextField. Code that treats a DocumentTarget as a TextField, casts it to one or calls a member that only TextField has, such as Text or Editable, doesn't compile against version 28.0. Use the members of DocumentTarget itself, such as TargetName.
  • TextFieldType.DocumentTarget removed. The value DocumentTarget of the TextFieldType enumeration was removed. Code that passes it, for example to GetTextFields, has to change; the targets of the main text are in TextControl.DocumentTargets.
  • Update notes. TextFieldType was extended with CheckFormField, DateFormField, SelectionFormField, TextFormField and FormFields. LoadSettings.ApplicationFieldFormat accepts the new value MSWordTXFormFields of ApplicationFieldFormat, which loads the form fields of MS Word as form fields of TX Text Control.
  • 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 28.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
ApplicationFieldCollectionItem
CheckFormFieldChecked, CheckedCharacter, SupportedCheckedCharacters, SupportedUncheckedCharacters, UncheckedCharacter
CheckFormFieldEventArgsCheckFormField
ConditionComparisonOperator, ComparisonValue, ComparisonValueType, FormField, LogicalConnective
ConditionalInstructionConditions, Instructions, NameCopy
ConditionalInstructionCollectionConditionalInstructionNames, CountAdd, Clear, CopyTo, GetEnumerator, GetItem, GetItems, IsValueValid, Remove
DateFormFieldDate, DateFormat, EmptyWidth, IsDateControlVisible, SupportedDateFormats
DateFormFieldEventArgsDateFormField
DocumentLinkCollectionItem
DocumentPermissionsAllowEditingFormFields
DocumentTargetCollectionItemGetItems
DocumentTargetEventArgsDocumentTarget
FormFieldEnabled
FormFieldCollectionConditionalInstructions, ItemAdd, Clear, CopyTo, GetItem, Remove
HeaderFooterFormFields
HypertextLinkCollectionItem
IFormattedTextFormFields
InstructionElseInstructionValue, FormField, InstructionType, InstructionValue, IsElseInstructionEnabled, IsFormFieldChangeInstruction, IsInitialInstruction
PageNumberFieldCollectionItem
SelectionFormFieldEmptyWidth, IsDropDownArrowVisible, Items, SelectedIndex
SelectionFormFieldEventArgsSelectionFormField
ServerTextControlFormFieldsOnDocumentTargetCreated, OnDocumentTargetDeleted, OnTextFieldCreated, OnTextFieldDeletedDocumentTargetCreated, DocumentTargetDeleted, TextFieldCreated, TextFieldDeleted
TextControlCanEditFormFields, DialogUnit, FormFields, IsFormFieldValidationEnabledConditionalInstructionDialog, ManageConditionalInstructionsDialog, OnDocumentTargetCreated, OnDocumentTargetDeleted, OnFormFieldCheckChanged, OnFormFieldDateChanged, OnFormFieldSelectionChanged, OnFormFieldTextChangedDocumentTargetCreated, DocumentTargetDeleted, FormFieldCheckChanged, FormFieldDateChanged, FormFieldSelectionChanged, FormFieldTextChanged
TextControl.ColorsActiveFormFieldColor, FormFieldColorResetActiveFormFieldColor, ResetFormFieldColor
TextFieldCollectionItem
TextFormFieldEmptyWidth
TextFormFieldEventArgsTextFormField
TextFrameFormFields
Windows.Forms.Ribbon.RibbonFormFieldsTabConditionalInstructionsHorizontalSidebar, ConditionalInstructionsSidebarFindItem
Windows.Forms.Ribbon.RibbonListViewEditItemTextBoxEmptyWidth, SelectWithArrowKeys

Next Steps

  • Version 29.0: the features of the next version.
  • Version 27.0: the features of the previous version.
  • Older Versions: all versions from 29.0 back to 10.1.
  • TX Text Control X18 has been Released: the release announcement on the Text Control Blog.