DevExpress WinForms拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!
DevExpress WinForms控件v25.1日前已经全新发布,新版本全新数据编辑器、AI聊天控件功能增强等,欢迎下载最新版体验!
数据编辑器
步骤进度条 - UX增强
DevExpress WinForms v25.1版本改进了基于步骤的导航工作流用户体验,在新版本中,用户可以按照如下方式与StepProgressBar项进行交互:
- 单击某项来选择它。
- 使用方向键在项目之间移动焦点。
- 按"Enter"或"Space"键选择一个项目。

新的StepProgressBar API包括:
- StepProgressBar.AllowUserInteraction - 指定用户是否可以与项交互。
- StepProgressBarItem.AllowUserInteraction - 防止用户与特定项交互。
- StepProgressBar.ItemClick - 当用户单击步骤进度栏中的项时发生,并允许您取消选择。
C#
cs
stepProgressBar1.AllowUserInteraction = true;
// ...
void StepProgressBar1_ItemClick(object sender, StepProgressBarItemClickEventArgs e) {
if (IsDataSaved(e.Item)) return;
if (XtraMessageBox.Show("You have unsaved changes. Would you like to save them?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
e.Handled = true;
}
SearchLookUpEdit - 同步查找面板文本
DevExpress WinForms SearchLookUpEdit允许用户为弹出视图指定查找面板文本,确保与FindFilterText属性同步。之前修改PopupView.FindFilterText属性不会更新查找面板的文本框,从而导致搜索行为不一致,这个增强确保查找面板显示实际应用的过滤器。
C#
cs
searchLookUpEdit.Properties.View.FindFilterText = "Mike";
MemoEdit - 布局控件内的自动高度
DevExpress WinForms MemoEdit控件包含了一个新的LayoutControlAutoHeightMode属性,此属性指定当放置在LayoutControl中时,MemoEdit的高度如何调整来适应内容,可用的自动高度模式包括:
- Default / None - MemoEdit高度保持固定,不随内容调整。如果内容超过可用高度,就会出现滚动条。
- GrowOnly - MemoEdit的高度增加来适配内容,但在内容减少时不会降低。
- GrowAndShrink - MemoEdit高度自动增加或减少来适配内容。

CheckedListBoxControl - 自定义SVG检查图标
DevExpress WinForms CheckedListBoxControl现在支持用户定义(自定义)SVG复选图标。在v25.1中,您可以为选中的、未选中的和灰色的项目状态指定唯一的图标。该增强支持自定义,来匹配应用程序主题/UI标准。

C#
cs
checkedListBoxControl1.CheckStyle = CheckStyles.UserDefined;
checkedListBoxControl1.ImageOptions.SvgImageChecked = svgImageCollection["checkedState"];
checkedListBoxControl1.ImageOptions.SvgImageUnchecked = svgImageCollection["uncheckedState"];
checkedListBoxControl1.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);
TokenEdit - 高级模式
v25.1包含了WinForms TokenEdit的新API,使用这些API,您可以自定义以下高级模式设置:
- Caret Animation (AllowCaretAnimation)
- Selection Animation (AllowSelectionAnimation)
- Selection Color Customization (SelectionColor)
使用TokenEdit.Properties.AdvancedModeOptions属性来访问高级模式设置:
C#
cs
// Enable Advanced Mode.
tokenEdit.Properties.UseAdvancedMode = DefaultBoolean.True;
// Enable caret animation.
tokenEdit.Properties.AdvancedModeOptions.AllowCaretAnimation = DefaultBoolean.True;
// Animate selection.
tokenEdit.Properties.AdvancedModeOptions.AllowSelectionAnimation = DefaultBoolean.True;
// Set selection color.
tokenEdit.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;
新版本还实现了一个新的QueryAdvancedMode静态事件,此事件为项目中的每个TokenEdit控件触发,并允许您根据参数配置高级模式设置。
C#
cs
using DevExpress.Utils;
using DevExpress.XtraEditors;
using System;
using System.Drawing;
using System.Windows.Forms;
namespace DXApplication {
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
TokenEdit.QueryAdvancedMode += TokenEdit1_QueryAdvancedMode;
Application.Run(new Form1());
}
static void TokenEdit1_QueryAdvancedMode(object sender, TokenEdit.QueryAdvancedModeEventArgs e) {
if(e.ParentForm is Form1) {
// Enable Advanced Mode.
e.UseAdvancedMode = DefaultBoolean.True;
// Set the selection color
e.Editor.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;
}
}
}
}
AI聊天控件
文件附件
用户现在可以将文件直接附加到他们的聊天消息中,这使得AI能够分析文档内容(如文本文件、PDF、图像),并提供更多的上下文感知响应。

启用FileUploadEnabled属性来允许用户附加文件,并根据您的项目需求配置相关设置(最大文件大小,允许的文件类型/扩展名,用户可以附加到消息的最大文件数量):
C#
cs
aiChatControl1.FileUploadEnabled = DevExpress.Utils.DefaultBoolean.True;
提示建议
为了帮助用户开始或探索新的可能性,DevExpress AI聊天控件可以显示提示建议。

使用SetPromptSuggestions方法提供智能建议:
C#
cs
using DevExpress.AIIntegration.Blazor.Chat.WebView;
aiChatControl1.SetPromptSuggestions(new List<PromptSuggestion>(){
new PromptSuggestion(
title: "Birthday Wish",
text: "A warm and cheerful birthday greeting message.",
prompt: "Write a heartfelt birthday message for a close friend."),
new PromptSuggestion(
"Thank You Note",
"A polite thank you note to express gratitude.",
"Compose a short thank you note to a colleague who helped with a project.")
});
停止响应
用户现在只需点击一下就可以打断冗长的AI回复。
