-
Notifications
You must be signed in to change notification settings - Fork 55
ChangeIconsColor
Carlo Barazzetta edited this page Mar 24, 2020
·
5 revisions
Opening the VCL Demo project you can test how to Change Icons Color (VCL)
Using the GroupBox at top-left of the Main form, you can see a tipical usage of this component: when a user change the appereance (Style) of the application, you can change the color of all the Icons, with a single line of code, using UpdateIconFontsColorByStyle, or using a custom approach:
{$IFDEF DXE+}
TStyleManager.TrySetStyle(LStyleName);
UpdateIconFontsColorByStyle(IconFontsImageList);
{$ELSE}
if LStyleName = 'Windows' then
IconFontsImageList.UpdateIconsAttributes(clBlack, clBtnFace, False)
else if LStyleName = 'Windows10' then
IconFontsImageList.UpdateIconsAttributes(clBlack, clWhite)
else if LStyleName = 'Windows10 SlateGray' then
IconFontsImageList.UpdateIconsAttributes(clWhite, clBlack)
else if LStyleName = 'Windows10 Blue' then
IconFontsImageList.UpdateIconsAttributes(clBlue, clGray)
else if LStyleName = 'Windows10 Dark' then
IconFontsImageList.UpdateIconsAttributes(clSilver, clBlack)
else if LStyleName = 'Windows10 Green' then
IconFontsImageList.UpdateIconsAttributes(clOlive, clGreen)
else if LStyleName = 'Windows10 Purple' then
IconFontsImageList.UpdateIconsAttributes(clRed, clPurple);
{$ENDIF}