WinForms — Early Access Preview (v23.1)

WinForms Team Blog
22 March 2023

Our next major release (v23.1) is a couple of months away. In this post, I'll describe the new features we included in our Early Access Preview (EAP) build. If you are an active DevExpress Universal or DXperience subscriber, you can download and install the EAP today (visit the DevExpress Download Manager to obtain our EAP build).

Early Access and CTP builds are provided solely for early testing purposes and are not ready for production use. This build can be installed side by side with other major versions of DevExpress products. Please backup your project and other important data before installing Early Access and CTP builds.

This EAP may not include all features/products we expect to ship in our v23.1 release cycle. As its name implies, the EAP offers an early preview of what we expect to ship in two months.

System and Custom Accent Colors in SVG Skins

DevExpress vector skins can now change associated colors once end users make a change to a system accent color in Microsoft Windows OS. Activate the WindowsFormsSettings.TrackWindowsAccentColor setting to enable this option*.

System and Custom Accent Colors in SVG Skins, DevExpress
using DevExpress.Utils;
using DevExpress.XtraEditors;

static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    WindowsFormsSettings.TrackWindowsAccentColor = DefaultBoolean.True;
    Application.Run(new Form1());
}

You can also specify a custom accent color and apply the desired appearance on the fly.

DevExpress.XtraEditors.WindowsFormsSettings.SetAccentColor(Color.FromArgb(16,124,65));

"The Bezier" skin supports a secondary accent color. Use the WindowsFormsSettings.SetAccentColor2 method to specify a second accent color.

* The WindowsFormsSettings.TrackWindowsAccentColor setting does not work with our High Contrast skin.

Support for Default App Mode in Windows OS

With this new feature, your Windows Forms application can automatically apply a light or dark color palette based on the Default App Mode setting in Microsoft Windows (display only light or dark color palettes in the skin gallery).

Support for Default App Mode in Windows OS, DevExpress

Use the WindowsFormsSettings.TrackWindowsAppMode property to enable this feature.

using DevExpress.XtraEditors;

static void Main() {
    Application.EnableVisualStyles();
    Application.SetCompatibleTextRenderingDefault(false);
    WindowsFormsSettings.TrackWindowsAppMode = DevExpress.Utils.DefaultBoolean.True;
    Application.Run(new Form1());
}

* Available for WXI, Basic, and Bezier skins.

Multiple Item Selection within Our WinForms Lookup Editor

Our WinForms Lookup Editor supports multiple item selection mode. When used, the lookup displays a checkbox selector column and allows users to select multiple items with ease. You can also specify how the lookup stores selected items: as a list of objects or a CSV string.

Multiple Item Selection - WinForms Lookup, DevExpress

New API includes:

  • EditValueType - Enables multiple item selection mode and specifies how the lookup stores selected items.
  • CheckBoxSelectorMember - Specifies the name of the field in a data source with the selected item state.
  • SelectionChanging - Occurs before a user selects an item in the dropdown and allows you to cancel the operation.
  • SelectionChanged - Occurs after a user selects an item in the dropdown.

Run Demo*

* This demo app requires installation of WinForms EAP v23.1. Download from DevExpress Download Manager

WinForms Ribbon UI — Office 365 Style

The WinForms Ribbon Control ships with a new Office 365 rendering style.

When our new Office 365 style is used, the Ribbon control displays a Search box at the top of the Ribbon form and displays Show Ribbon options on the bottom right of the Ribbon UI.

Office 365 Style in WinForms Ribbon UI, DevExpress
using DevExpress.XtraBars.Ribbon;

ribbonControl.RibbonStyle = RibbonControlStyle.Office365;

Use the following API to enable new UI enhancements in other Ribbon styles:

  • RibbonControl.OptionsExpandCollapseMenu - Gets the availability and behavior settings for the "Show Ribbon" popup menu.
  • RibbonControl.ExpandCollapseMenuShowing - Allows you to customize the "Show Ribbon" menu or prevent it from being displayed based on a specific condition.
  • RibbonControl.SearchItemPosition - Specifies the position of the Search box.

Show Alerts within the Ribbon Message Bar

We implemented new APIs to display Office-inspired flyout notifications and alerts.

Alerts in Ribbon Message Bar, DevExpress
using DevExpress.XtraBars.Ribbon;

void ShowMessage() {
    RibbonMessageArgs args = new RibbonMessageArgs();
    args.Caption = "What's New";
    args.Text = "Explore new WinForms-related features we expect to introduce in our first major update this year (v23.1).";
    args.Icon = MessageBoxIcon.Information;
    args.Buttons = new DialogResult[] { DialogResult.OK };
    args.Showing += Args_Showing;
    Ribbon.ShowMessage(args);
    Ribbon.MessageClosed += Ribbon_MessageClosed;
}
void Ribbon_MessageClosed(object sender, RibbonMessageClosedArgs e) {
    if(e.Result == DialogResult.OK)
        Data.Utils.SafeProcess.Start("https://community.devexpress.com/blogs/winforms/archive/2023/02/16/devexpress-winforms-roadmap-23-1.aspx");
}
void Args_Showing(object sender, RibbonMessageShowingArgs e) {
    e.Buttons[DialogResult.OK].Caption = "Explore Roadmap";
}

New APIs include:

  • RibbonControl.ShowMessage - Displays a message in the message bar.
  • RibbonControl.CloseMessage - Closes the specified message.
  • RibbonControl.MessageClosed - Occurs after a message is closed and allows you to handle button clicks.
  • RibbonControl.Messages - Gets a collection of messages displayed in the message bar.

Align Items to Top and Bottom in Backstage View

Bar item settings include a new alignment option. You can now align items to the top and bottom of the Backstage view.

Align Items to Top and Bottom in Backstage View - WinForms Ribbon UI, DevExpress
using DevExpress.XtraBars.Ribbon;

optionsBackstageViewItem.Alignment = BackstageViewItemAlignment.Bottom;

Timeline in WinForms Gantt Control

Our WinForms Gantt Control now ships with an integrated Timeline. Features include:

  • Multiple Timeline Bars
  • Add/Remove Tasks and Milestones to/from Timeline
  • Configurable Date Range
  • Task Selection
  • Built-in Context Menu
  • Comprehensive Timeline API
Timeline in WinForms Gantt Control, DevExpress

Run Demo*

* This demo app requires installation of WinForms EAP v23.1. Download from DevExpress Download Manager

Preview Pane in DevExpress Dialogs

Our WinForms File Dialog components now include an integrated preview pane. With it, users can preview Office-related documents (e.g., DOCX, XLSX, CSV), PDFs, HTML files, text files, and images before opening the actual file.

Preview Pane in DevExpress Dialogs for WinForms

Run Demo*

* This demo app requires installation of WinForms EAP v23.1. Download from DevExpress Download Manager

WinForms TreeList — HTML & CSS Templates

The DevExpress WinForms TreeList Control ships with HTML & CSS Template support. You can now create unique custom layouts for TreeList nodes and the TreeList itself when empty.

HTML and CSS Templates in DevExpress TreeList for WinForms

New API includes:

  • TreeList.HtmlTemplates - A collection of HTML-CSS templates that can be applied to TreeList UI elements.
  • TreeList.NodeHtmlTemplate - Specifies the default HTML-CSS template for nodes.
  • TreeList.EmptyTreeHtmlTemplate - Specifies the default HTML-CSS template for a TreeList control when empty.
  • TreeList.QueryNodeTemplate - Allows you to assign HTML-CSS templates to nodes based on a specific condition.
  • TreeList.QueryEmptyTreeTemplate - Allows you to assign HTML-CSS templates to an empty TreeList based on a specific condition.
  • TreeList.CustomizeNodeTemplate - Allows you to customize templated nodes.

Run Demo*

* This demo app requires installation of WinForms EAP v23.1. Download from DevExpress Download Manager

Item Templates for .NET 6+ Applications

You can now use the following DevExpress Item Templates in Windows Forms applications for .NET:

  • UI-ready User Control
  • UI-ready Form
  • Custom Data Editor
  • Custom Data Grid
WinForms Item Templates for .NET Applications

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.