Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control
TX Text Control X15 introduces a bounds property on fields in Web.TextControl, returned through the textFieldEntered event. Developers can position custom HTML overlays at field locations to display merge field names, open property dialogs, or render form elements over fields.

A highly requested feature for our HTML5-based Web.TextControl is the ability to show field overlays or custom elements such as HTML form elements on top of all types of fields.
In version X15, fields provide it's location using the bounds property that can be used to render a custom overlay at this location. The following screen video shows a sample implementation of these custom overlays:

The pop-up overlay can be used to display the field name and specific properties of a merge field. Additionally, a button has been added to open a field properties dialog directly from the overlay.
The textFieldEntered event returns the TextFieldEventArgs object that contains the bounds property (in version X15):
function textFieldEnteredHandler(e) {
_fieldBounds = e.bounds;
_fieldName = e.fieldName;
_fieldParameters = e.parameters;
drawOverlay();
}
Based on the relative bounds location and the text view offset location, the position of the field relative to the Web.TextControl can be easily calculated and used to display any overlay at that location. By listening on the zoomFactorChanged and textViewLocationChanged events, the layover can be also moved when the document is scrolled and zoomed.
This concept can be used for many different applications including the rendering of form elements on top of MS Word form fields and content control fields. All of these fields are accessible in version X15 using the new TXTextControl.getTextFields method that returns an ApplicationField object. This allows the development of MS Word compatible form completion applications based on Web.TextControl.
Also See
This post references the following in the documentation:
- Javascript: Text
View Location Changed Event Args Object - Javascript: TXText
Control.get Text Fields Method - Javascript: Zoom
Factor Changed Event Args Object - TXText
Control. Web. Text Control Class
Jump to the other posts in this series:
- Sneak Peek X15: UI Automation Interface for TX Text Control .NET for WPF
- Sneak Peek X15: Watermarks and Objects in Headers and Footers Behind the Main Text
- Sneak Peek X15: Ribbon Chart Layout Tab
- Sneak Peek X15: Custom Field Overlays in HTML5-based Text Control
- Sneak Peek X15: Copy to Local Clipboard Support in ASP.NET Version
- Sneak Peek X15: Contextual Chart Ribbon Tabs
- Sneak Peek X15: Add Formatting Using the Mini Toolbar
- Sneak Peek X15: Keeping Table Rows Together
Reporting
The Text Control Reporting Framework combines powerful reporting features with an easy-to-use, MS Word compatible word processor. Users can create documents and templates using ordinary Microsoft Word skills. The Reporting Framework is included in all .NET based TX Text Control products including ASP.NET, Windows Forms and WPF.
Related Posts
MVC NuGet Packages for X18 Published
We just published the NuGet packages for the latest version X18 of TX Text Control .NET Server.
Sneak Peek X15: Copy to Local Clipboard Support in ASP.NET Version
TX Text Control X15 introduces local clipboard support for the HTML5 ASP.NET editor. A toggle switches between the server-side clipboard with full formatting and the client-side HTML clipboard.…
New ASP.NET MVC DocumentViewer Rolled out to the ReportingCloud Portal
The ReportingCloud portal now features an ASP.NET MVC DocumentViewer for previewing stored templates. It loads pages asynchronously, displays thumbnail navigation in a sidebar, supports text…
Updated MVC Sample: Loading Files from the Backstage Menu
The ASP.NET MVC backstage menu sample has been updated to TX Text Control X14 with the latest NuGet packages. The backstage view replaces the default file menu with a customizable, MS Word-style…
Updated TXTextControl.Web MVC NuGet Package
TXTextControl.Web MVC NuGet package updated to 23.0.304.500 with X13 Service Pack 1. Fixes address ReadAndSelect edit mode formatting, iOS virtual keyboard input since 9.2, and symbol insertion in…
