Using custom styles shows invalid characters when right-clicking a file in TOpenDialog

痴心易碎 提交于 2019-12-10 02:04:06

问题


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)


回答1:


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.



来源:https://stackoverflow.com/questions/32206737/using-custom-styles-shows-invalid-characters-when-right-clicking-a-file-in-topen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!