丑陋的“禁用” TMainMenu的图像 [英] Ugly "disabled" images of TMainMenu

查看:149
本文介绍了丑陋的“禁用” TMainMenu的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Delphi 2010,Win32 VCL。我需要用最标准的外观为我的应用程序创建一个主菜单。 TMainMenu在所有Windows版本中看起来不错,唯一不好的是当它显示Enabled = False的项目的图像时。

Delphi 2010, Win32 VCL. I need to create a main menu for my application with the most standard look. TMainMenu looks nice in all Windows versions, the only bad thing is when it displaying images for items with Enabled=False.

Delphi有一些奇怪的方法来构建禁用的图像(b / w挤出与斜面,对我来说,它像spew)。我想在VCL源中为该过程制作一个补丁,并让菜单从同一个TImageList中选择禁用的图像,但是找不到。

Delphi has some strange method for building that disabled images (b/w extrusion with bevels, for me it looks like spew). I want to make a patch for that procedure in VCL sources and let menu to select disabled images from the same TImageList, but I can't find it.

是否存在或者是某些标准的Windows API调用?你知道该程序位于哪里?

Is it exists at all or it is some standard windows API call? Do you know where is that procedure located?

确定OwnerDraw样式可以修复所有这些,但我想要一个更快的解决方案。

Sure OwnerDraw style can fix all this but I want a bit faster solution.

推荐答案

Galfar的Lair博客,其中描述了问题,并提供了解决方法的代码,覆盖了TImageList DoDraw方法。

There's a great post on Galfar's Lair blog which describes the problem, and has code for a workaround, overriding the TImageList DoDraw method.

这里是显示'before'和'after'的图片(链接)。

Here's the pic (linked) showing the 'before' and 'after'.

我认为这与几乎所有的Delphi版本。

I think this relates to pretty much all Delphi versions.

这篇关于丑陋的“禁用” TMainMenu的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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