The Unofficial Newsletter of Delphi Users - by Robert Vivrette


Fixing a Menu Drawing Glitch in Delphi 4

by David Yowell - yowelld@hotmail.com

You may have noticed that the images for certain disabled menu items in the Delphi 4 look like indistinguishable gray blobs as seen in the following figure.

The glitch is in the VCL so it affects both the Delphi IDE and user applications created with Delphi. However, there is an easy fix that involves changing a few lines of code in the ImgList unit. In the TCustomImageList.DoDraw method eliminate line 583:

and in its place put With that change, your menus will now look like this!

Note: Modifying the code for your Delphi 4 VCL has a few pitfalls. You may want to make sure you understand what you are doing before changing code shipped from Borland/Inprise. If you need a little hand-holding, here is the key points you need to look out for:

Instructions for modifying the VCL:

A few considerations: