trayicon Icon property
Return to Introduction  Previous page  Next page
Applies to
acTrayIcon and acAppEvents components.  

Declaration
property Icon: TIcon;  

Description
The Icon property determines the icon that is displayed in system tray area when acTrayIcon component is visible.  
 
If list of images already assigned to ImageList property, then images assigned to ImageList will be used for displaying the tray icon.  
 
If no Icon and ImageList assigned, then for displaying the tray icon acTrayIcon component will use the application icon (Application.Icon property).  

Note
iiwarning This property CAN contain high-color icon. However, you must know that icons in the system tray with 256 and more colors can be visible only in Windows ME / XP and higher. All lower versions (Win95/98/NT4/2000) can display 16 colors only!  
 
So if you decided to use high-color icon for WinME/XP, but still want to make it looks fine in lower Windows versions, you can specify 256 colors icon to Icon property and 16 colors icon to Icon16 property. Otherwise, if you have only 16-colors icon or just don't care about look in older Windows version, then specify just Icon property only, or use image from ImageList.  
 
tip Alternatively you can use just icons from ImageList, determinate the Windows version, and show 16-color icons on Win95/98/NT4/2000 and 256-color icons on WinME/XP and higher. To determinate whether the 256 colors icon are allowed in the system tray, you can use Is256ColorTrayIconAllowed function from acUtils unit.  

See also
Icon16, ImageList and ImageIndex properties.