在TOpenDialog中右键单击文件时,使用自定义样式显示无效字符 [英] Using custom styles shows invalid characters when right-clicking a file in TOpenDialog
问题描述
请参阅以下步骤进行复制。在XE2中运行良好但不是XE8。
- 创建一个新的VCL Forms应用程序 - Delphi
- 放置表单上的
TButton
和TOpenDialog
- 在按钮
OnClick
事件调用OpenDialog1.Execute
- 运行程序,打开文件对话框,右键单击文本文件=>显示菜单项OK
- 转到项目/选项/应用程序/外观。启用并选择自定义样式(如Ruby Graphite)并重新编译
- 运行程序,打开文件对话框,右键单击文本文件=>不显示菜单项正确(无效字符显示)
使用XE8订阅更新1(Windows从8.1升级到10)进行测试
Windows 10引入了代码中的一些内部更改,负责绘制shell弹出菜单。所以VCL风格代码必须被修改为与Windows 10兼容。我刚刚报告了
See steps below to reproduce. Works well in XE2 but not XE8.
- Create a new VCL Forms Application - Delphi
- Place a
TButton
and aTOpenDialog
on the form - In the button
OnClick
event callOpenDialog1.Execute
- Run the program, open the file dialog, and right-click on a text file => shows menu items ok
- Go to Project/Options/Application/Appearance. Enable and choose a custom style (such as "Ruby Graphite") and recompile
- Run the program, open the file dialog, and right-click a text file => does not show menu items correctly (invalid characters are shown)
Tested with XE8 Subscription Update 1 (and Windows upgraded from 8.1 to 10)
Windows 10 introduces some internal changes in the code responsible to draw the shell popup-menus. So the VCL Style code must be modified to be compatible with Windows 10. I just reported this to EMB
As workaround you can use the VCL Styles Utils project which fixes this issue (only you need add the Vcl.Styles.Utils.Menus
unit to your project).
Check the next Image , The left popup-menu uses the standard VCL Styles,and the right menu uses the VCL Styles Utils
project.
这篇关于在TOpenDialog中右键单击文件时,使用自定义样式显示无效字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!