I have made a few changes to the code in Fake TSpeedButton based on a TBitBtn:
- I replaced all that line drawing with a call to the WinAPI function DrawEdge.
- I set both bitmaps to Transparent.
- I moved the bitmap generation to a sub procedure.
Thus I got rid of about 20 LOC. That’s negative productivity for you. đ
(Which yet again shows that Lines Of Code is an idiotic metric for software developer productivity.)
The code has been tested with several Delphi versions (6, 7, 2007, XE2 and 10.2) in Windows 8.1 and is now used in the GExperts Rename Component Expert. There is no release yet, but you can always compile your own.