在TOpenDialog中右键单击文件时,使用自定义样式显示无效字符 [英] Using custom styles shows invalid characters when right-clicking a file in TOpenDialog

查看:202
本文介绍了在TOpenDialog中右键单击文件时,使用自定义样式显示无效字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅以下步骤进行复制。在XE2中运行良好但不是XE8。


  1. 创建一个新的VCL Forms应用程序 - Delphi

  2. 放置表单上的 TButton TOpenDialog

  3. 在按钮 OnClick 事件调用 OpenDialog1.Execute

  4. 运行程序,打开文件对话框,右键单击文本文件=>显示菜单项OK

  5. 转到项目/选项/应用程序/外观。启用并选择自定义样式(如Ruby Graphite)并重新编译

  6. 运行程序,打开文件对话框,右键单击文本文件=>不显示菜单项正确(无效字符显示)

使用XE8订阅更新1(Windows从8.1升级到10)进行测试

解决方案

Windows 10引入了代码中的一些内部更改,负责绘制shell弹出菜单。所以VCL风格代码必须被修改为与Windows 10兼容。我刚刚报告了


See steps below to reproduce. Works well in XE2 but not XE8.

  1. Create a new VCL Forms Application - Delphi
  2. Place a TButton and a TOpenDialog on the form
  3. In the button OnClick event call OpenDialog1.Execute
  4. Run the program, open the file dialog, and right-click on a text file => shows menu items ok
  5. Go to Project/Options/Application/Appearance. Enable and choose a custom style (such as "Ruby Graphite") and recompile
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆