界面控件DevExpress WinForms v25.1新功能预览 - 功能区组件全新升级

DevExpress WinForms拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!

DevExpress下一个主要更新(v25.1)将在几个月后发布,正如我们之前提到的那样,新的桌面开发标准(. NET Core、AI、可访问性)仍然是重点关注的领域。在本文中,我们为大家介绍了.DevExpress WinForms在功能区组件方面的升级,欢迎下载最新版控件体验!

获取DevExpress WinForms 正式版下载

WinForms Ribbon和Bars
最大化/最小化Ribbon

新的API包括:

识别Bar项和Bar链接

新的API包括:

cs 复制代码
barManager1.ItemClick += (sender, e) => {
BarItem item = barManager1.GetItemAt(Cursor.Position);
// BarItemLink itemLink = barManager1.GetLinkAt(Cursor.Position);
Debug.WriteLine(item.Caption);
};
处理栏项目右键单击

DevExpress WinForms Bar Manager(栏管理器)和Ribbon控件将支持对栏项进行右键操作,新事件包括:

v25.1还将引入了一个新的e.MouseButtton事件参数,它允许您识别按下的鼠标按钮。

基于助记符的子菜单导航

在v25.1中,官方增强了传统的基于工具栏的用户界面键盘可访问性。用户可以使用相同的助记符循环遍历子菜单项(在标题中用&表示),当子菜单中的多个项目具有相同的助记符时,重复的按键按顺序浏览它们。该特性是自动启用的,不需要额外的配置。

cs 复制代码
barItemSaveAs.Caption = "Save &As";
barItemSaveAll.Caption = "Save &All";
BarItem - 支持AutomationId

AutomationId属性 - 在自动化测试和可访问性(a11y) 工具中区分UI元素的唯一标识符------现在可用于BarItem对象,此属性自动设置为栏项的名称。

BarToggleSwitchItem - 切换开关宽度

在v25.1中,您可以指定切换开关栏的宽度,使用EditorToThumbWidthRatio属性设置项目的总宽度相对于拇指的宽度。

WinForms Accordion(折叠)控件
徽章和提示

官方将DevExpress WinForms Accordion控件与装饰器UI管理器集成在一起,来帮助显示徽章/提示并突出显示特定的Accordion UI元素。

cs 复制代码
using System.Drawing;
using DevExpress.Utils.VisualEffects;
// ...
Badge badgeInbox;
public Form1() {
InitializeComponent();
badgeInbox = new Badge();
// Assign the badge to the 'Inbox' accordion item
badgeInbox.TargetElement = accordionItemInbox;
// Specify badge text
badgeInbox.Properties.Text = "17";
// Specify badge location and offset
badgeInbox.Properties.Location = ContentAlignment.TopLeft;
badgeInbox.Properties.Offset = new Point(85, 6);
// Customize badge appearance
badgeInbox.Appearance.BackColor = Color.Gray;
badgeInbox.Appearance.BorderColor = Color.Gray;
badgeInbox.Appearance.ForeColor = Color.White;
badgeInbox.Appearance.Font = new Font("Tahoma", 8.25F, FontStyle.Bold);

// Add the badge to the AdornerUIManager
adornerUIManager1.Elements.Add(badgeInbox);
}
快捷键

Accordion(折叠)现在支持键盘快捷键,使用ShortcutKey属性指定预定义或自定义键盘快捷方式。这种增强提高了可访问性,特别是对于具有复杂导航结构的应用程序。

XtraMessageBox功能增强

V25.1引入了新的功能,旨在:

  • 在Windows任务栏中显示DevExpress消息框,确保用户可以轻松访问。
  • 定义消息框在屏幕上的起始位置。
cs 复制代码
void messageButton_Click(object sender, EventArgs e) {
XtraMessageBoxArgs args = new XtraMessageBoxArgs() {
Caption = "Tip",
Text = "Hello DevExpress!",
Buttons = new DialogResult[] { DialogResult.OK },
};
args.ImageOptions.SvgImage = svgImageCollection1["info"];
args.ImageOptions.SvgImageSize = new Size(32, 32);
args.Showing += Args_Showing;
XtraMessageBox.Show(args);
}
void Args_Showing(object sender, XtraMessageShowingArgs e) {
// Get the screen working area
Rectangle workingArea = Screen.PrimaryScreen.WorkingArea;

// Calculate bottom-right position
int x = workingArea.Right - e.MessageBoxForm.Width;
int y = workingArea.Bottom - e.MessageBoxForm.Height;

// Define message box start position
e.MessageBoxForm.StartPosition = FormStartPosition.Manual;
e.MessageBoxForm.Location = new Point(x, y);

// Display the message box in the Windows taskbar
e.MessageBoxForm.ShowInTaskbar = true;
}
相关推荐
龙山云仓13 分钟前
小G&老D求解:第7日·立夏·蝼蝈鸣
人工智能·机器学习
LaughingZhu24 分钟前
Product Hunt 每日热榜 | 2026-04-30
人工智能·经验分享·深度学习·神经网络·产品运营
sunneo30 分钟前
专栏D-团队与组织-03-产品文化
人工智能·产品运营·aigc·产品经理·ai编程
Muyuan199830 分钟前
28.Paper RAG Agent 开发记录:修复 LLM Rerank 的解析、Fallback 与可验证性
linux·人工智能·windows·python·django·fastapi
小呆呆66644 分钟前
Codex 穷鬼大救星
前端·人工智能·后端
薛定猫AI1 小时前
【深度解析】Kimi K2.6 的长上下文 Agentic Coding 能力与 OpenAI 兼容 API 接入实践
人工智能·自动化·知识图谱
星爷AG I1 小时前
20-6 记忆整合(AGI基础理论)
人工智能·agi
AI创界者1 小时前
人工智能 GPT-Image DMXAPI Python AI绘画
人工智能
播播资源1 小时前
GPT-5.5 模型功能深度解析:从模型介绍、核心特点到应用场景全景分析 如何快速接入使用
人工智能·gpt
谁似人间西林客1 小时前
工厂大脑是什么?从经验驱动到AI辅助的决策跃迁
人工智能