WinForms TextEdit — New v20.2 Features (CTP)

WinForms Team Blog
19 October 2020

We recently published a list of enhancements and new features we expect to ship across our WinForms product line in our v20.2 release cycle: What’s New in v20.2.

We expect to update this list prior to release as it does not include a complete summary of new WinForms-related features/products. One of the features we did not include in beta involves our new “Advanced Mode” for our WinForms Text Editors. This new option adds a number of interesting options to all of our TextEdit-based WinForms editors (except for TokenEdit, HyperTextLabel and HyperlinkEdit controls).

To activate this new mode, enable the Properties.UseAdvancedMode property, or (if you want to upgrade all editors in your app) the static WindowsFormsSettings.UseAdvancedTextEdit property.

Animated Caret and Selection

We reworked TextEdit painters so that caret movement and text selection are more pleasing to the eye (smoother, more elegant):

Additionally, text selection color is now based on the currently applied skin.

Caret and selection animations are managed by the AdvancedModeOptions.AllowCaretAnimation and AdvancedModeOptions.AllowSelectionAnimation properties.

Embedded Labels

Labels are a text box controls best friends - they seem to always travel together. If an app includes a text box for first name values, it will often have a “First Name” label next to the text box itself. Otherwise, users would have no way to distinguish the purpose of the text field.

In our new advanced mode you can set the AdvancedModeOptions.Label property and the editor will embed this string directly within the text box. I think you’ll agree that this is an elegant solution for those who want to eliminate use of field labels.

As you can see in this animation, this updated mode is fully compatible with our overhauled mask engine (if you’ve missed this major update announcement, see the “Editors” section of our What’s New page: WinForms Controls v20.2)


Whether your users insert a string that contains an emoji, or press the “Win+.” hotkey to enter an emoji from the Windows library, text editors running in this new mode will display them automatically. Note: if you want colored emojis, you will need to enable the AdvancedModeOptions.UseDirectXPaint property for required editors. Otherwise, editors will display black-and-white versions of standard emojis.

Performance Upgrade

Of course, this wouldn’t be a DevExpress feature without meaningful performance enhancements. Text Edit controls in this new advanced mode allow users to insert text blocks of any sizes (standard editors have the 32,767 characters limitation). And yes, text insert operations are faster than the Windows Notepad even with text wrapping enabled.

During our tests, we resized a sample edit form with 400 text edits. A form with our updated text edit results in 1,581,427 ticks on average – a 37% boost when compared to the 2,542,614 ticks for a form with standard text edits.

Download and run the following samples to test the smoothness of our text box with 100,000 lines: MemoEdit Sample, TextEdit Sample.

Tell Us What You Think

By now, you may be wondering why we implemented a dedicated mode for these new features. The reason is that TextEdits in “advanced” and “standard” mode are significantly different controls (though you won’t notice any difference).

A TextEdit running in standard mode uses the default WinForms masked text box. We have added a pinch of DevExpress flavor to this default control, but at its core, this is still the same control with all of its strengths and weaknesses. Our “advanced” Text Edit uses a completely different control. This allows us to access and modify all portions of the control (like caret and movement animations). On the downside, such a new control can introduce unforeseen issues – simply said, when you create your own implementation of a platform’s most frequently used control, chances are high that something, somewhere will not work as expected.

The “UseAdvancedMode” property is a safety kill switch that allows you to instantly roll-back to the standard DevExpress TextEdit should you encounter issues (however rare those issues might be). We expect this mode to be the default in a future release – once we have rock-solid evidence that all outstanding issues have been addressed. For now, please test this mode in your solutions and share your feedback.

And do comment below - Do you see a place for these upgraded text editors in your next WinForms app?

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.