Author Topic: Fake Icon on TButton  (Read 852 times)


  • Hero Member
  • *****
  • Posts: 2400
Fake Icon on TButton
« on: March 10, 2021, 10:26:33 pm »

If you need an Icon on a button it is getting busy: TBitBtn or TSpeedButton or even something homegrown.

On the other hand I am bothered about the increasing "kindergarden stuff" in Unicode. But you can apply them in a useful way.

As Lazarus works with UTF8 and the OS all working with Unicode the question arises:

What is an OS doing with a component which only allows a black font and UTF8 chars?
Look: colored icons.

So we come to the trick to replace the ugly system icons of the TBitBtn, colorize them and use a simple TButton.

We search the needed UTF8 Icons in the endlesse tables from the codeblock Dingbats.

Then we insert as caption of the TButton just:

'❌ Nein'

The colored cross appears on the button - a least with gtk2.

Example in attachment.
Hope it saves work.



  • Sr. Member
  • ****
  • Posts: 275
Re: Fake Icon on TButton
« Reply #1 on: March 11, 2021, 02:07:17 pm »
In Windows 10 unfortunately there is no color when I paste your example. I also tried '✅', and it's black.


TinyPortal © 2005-2018