How can I display the built-in icons on the buttons? lazarus / 31-LCL ---------------------------------------------------------------------- iruanpan · 2024-01-28 05:26 Excuse me. How can I display the built-in icons on the buttons? The application was compiled with an icon collection. Can I display one of these icons on a button component? ---------------------------------------------------------------------- KodeZwerg · 2024-01-28 06:18 You need to place Icons in the RT_ICON section and call my method image1 = do it like i show image2 = the clean button image3 = after button was pressed and here is the code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure AssignIcon(const ABitBtn: TBitBtn; const AName: string);var  ico: TIcon;begin  ico := TIcon.Create;  try    ico.LoadFromResourceName(HINSTANCE, AName);    ABitBtn.Glyph.Assign(ico);  finally    ico.Free;  end;end; procedure TForm1.BitBtn1Click(Sender: TObject);begin  if Sender is TBitBtn then    AssignIcon((Sender as TBitBtn), 'HEART');end; Enjoy! ---------------------------------------------------------------------- wp · 2024-01-28 11:14 The resources shown in your screenshot seem to be the default resource files which the LCL is linking in. These resources are use by TBitBtn and TSpeedButton as default icons. Simply set the Kind property, and the icon corresponding to the Kind value, will appear. ---------------------------------------------------------------------- iruanpan · 2024-01-28 11:27 Quote from: KodeZwerg on January 28, 2024, 07:18:27 amYou need to place Icons in the RT_ICON section and call my method image1 = do it like i show image2 = the clean button image3 = after button was pressed and here is the code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure AssignIcon(const ABitBtn: TBitBtn; const AName: string);var  ico: TIcon;begin  ico := TIcon.Create;  try    ico.LoadFromResourceName(HINSTANCE, AName);    ABitBtn.Glyph.Assign(ico);  finally    ico.Free;  end;end; procedure TForm1.BitBtn1Click(Sender: TObject);begin  if Sender is TBitBtn then    AssignIcon((Sender as TBitBtn), 'HEART');end; Enjoy! Thank you very much for your help ---------------------------------------------------------------------- iruanpan · 2024-01-28 11:28 Quote from: wp on January 28, 2024, 12:14:15 pmThe resources shown in your screenshot seem to be the default resource files which the LCL is linking in. These resources are use by TBitBtn and TSpeedButton as default icons. Simply set the Kind property, and the icon corresponding to the Kind value, will appear. That's what I want. Thank you very much for your help!