A first look at the new features of DevExpress WinForms v23.1 - support system accent color change

The next major version (v23.1) of DevExpress WinForm will be released around June, and this article will introduce the new features included in the Early Access Preview (EAP).

PS: DevExpress WinForm has 180+ components and UI library, which can create influential business solutions for Windows Forms platform. DevExpress WinForm can perfectly build smooth, beautiful and easy-to-use applications, whether it is an Office-style interface or analyzing and processing large quantities of business data, it can easily do it!

Get DevExpress v22.2 official version download (Q technical exchange: 523159565)

System and custom accent colors in SVG skins

DevExpress vector skins can now change the associated color once the end user changes the accent color in Microsoft Windows OS, enable this option by activating the WindowsFormsSettings.TrackWindowsAccentColor setting.

using DevExpress.Utils;
using DevExpress.XtraEditors;

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

Users can also specify a custom accent color and dynamically apply the desired look.

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

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

The WindowsFormsSettings.TrackWindowsAccentColor setting does not work with high contrast skins.

Support default application mode in Windows operating system

With this new feature, a user's Windows Forms application can automatically apply a light or dark color palette (only light or dark color palettes are displayed in the skin gallery) based on the default application mode setting in Microsoft Windows.

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.

Multi-item selection in WinForms Lookup Editor

WinForms Lookup Editor supports multiple selection mode. When used, find displays a checkbox selector column and allows the user to easily select multiple items. Users can also specify how the lookup stores selected items: as a list of objects or as a CSV string.

New APIs include:

  • EditValueType - Enables multiple selection mode and specifies how the lookup stores selected items.
  • CheckBoxSelectorMember - Specifies the name of the field in the data source that has the selected item status.
  • SelectionChanging - Occurs before the user selects an item in the dropdown menu, and allows you to cancel the action.
  • SelectionChanged - Occurs when the user selects an item in the drop-down menu.

WinForms Ribbon UI — Office 365 style

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

When using the new Office 365 style, the Ribbon control displays a search box at the top of the Ribbon form and the Ribbon Options at the bottom right of the Ribbon UI.

using DevExpress.XtraBars.Ribbon;

ribbonControl.RibbonStyle = RibbonControlStyle.Office365;

Enable new UI enhancements in other ribbon styles using the following APIs:

  • RibbonControl.OptionsExpandCollapseMenu - Gets the "Show Ribbon" availability and action settings.
  • RibbonControl.ExpandCollapseMenuShowing - Allows developers to customize the "Show Ribbon" menu or prevent it from showing based on certain conditions.
  • RibbonControl.SearchItemPosition - Specifies the position of the Search box.

Display reminders in the Ribbon message bar

New API implemented in v23.1 to display Office-inspired pop-up notifications and alerts.

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 - Shows a message in the message bar.
  • RibbonControl.CloseMessage - closes the specified message.
  • RibbonControl.MessageClosed - Occurs after the message is closed and allows you to handle button clicks.
  • RibbonControl.Messages - Gets the set of messages displayed in the message bar.

Guess you like

Origin blog.csdn.net/AABBbaby/article/details/131080642