DevExpress WinForm?2022年发布的第一个重大版本——v22.1升级了对支持High-DPI及其他辅助功能增强,一起来了解一下还有哪些更新吧!
支持High-DPI
支持PerMonitorV2伸缩
此版本改进了以下WinForms控件,以保持混合模式DPI缩放:
- BI Dashboard
- Map Control
- PDF Viewer
- Rich Text Editor
- Spreadsheet
- Sunburst
- TreeMap
- Reporting – Document Viewer
UI自动化
启用一个新的静态WindowsFormsSettings.UseUIAutomation选项使用Microsoft UIAutomation,它提供对桌面上大多数用户界面(UI)元素的程序化访问,并允许自动化测试脚本与UI交互。
可访问性
为所有DevExpress控件定制可访问性信息
新版本引入了一个新的静态’DXAccessible.QueryAccessibleInfo’ 事件,它作为一个入口点,为您的WinForm应用程序中的所有DevExpress控件定制可访问性信息。如果您在应用中使用来自多个程序集的控件(例如Data Grid, Editors, Charts, PivotGrid),那么每个控件都会触发QueryAccessibleInfo事件。
C#
using System.Windows.Forms;using DevExpress.Accessibility;//...public XtraForm1() {InitializeComponent();DXAccessible.QueryAccessibleInfo += OnQueryAccessibleInfo;}void OnQueryAccessibleInfo(object sender, object sender, DXAccessible.QueryAccessibleInfoEventArgs e) {if(e.OwnerControl == gridControl1)if(e.Role == AccessibleRole.Row)e.Name = "my row text";}
注意:’QueryAccessibleInfo’事件是一个弱事件,您应该将其处理程序声明为表单类中的一个方法,否则就会发生垃圾回收。
常见的增强
此版本将’AccessibleName’, ‘AccessibleRole’, ‘AccessibleDescription’属性添加到以下类:
- Bar (和 BaseRibbonComponent)
- NavBarGroup
- NavBarItem
- RecentItemBase
- BackstageViewItemBase
- TileItem
- RowProperties
- BaseDocument
还为以下组件引入了’AccessibleRole’属性:
- AccordionControlElementBase
- BarItem
- GalleryItem
- GridBand
- GridColumn
- PivotGridField
- TreeListBand
- TreeListColumn
同时技术团队还检查了Data Grid, TreeList, Data Editors, Ribbon, Bars, Accordion, Layout Control和Dock Windows,来解决可能的可访问性问题,这些UI控件现在具有正确的UI Automation属性并生成预期的事件。
禁用所有DevExpress控件的可访问性
一个新的静态WindowsFormsSettings.DisableAccessibility属性允许您禁用WinForms应用程序中所有DevExpress控件的“DevExpress”可访问性。
同时还添加了一个新的静态SuppressExcessiveAccessibilityNotifications选项,当Windows Narrator的 ‘Read and interact with the screen using the mouse’设置关闭时,此选项允许您在鼠标悬停时启用/禁用可访问性事件,WinForms Data Grid, Verticel Grid和TreeList控件也支持这种操作。
诊断代码(CTP)

安装’DevExpress.Win.CodeAnalysis’ 包来启用代码诊断,分析器需要Visual Studio 2019或更新的版本,并支持 .NET Framework 和 .NET 5+。
DevExpress技术交流群6:600715373 欢迎一起进群讨论

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!