| Tray Icon Control |
Applies To |
|
| OS: VB: |
NT, 9x, 2000 5, 6 |
|
Now and then it is useful to place an app in the system tray. This control let's you add multiple icons to the system tray, it let's you add, modify and remove the icons and tooltip on demand. It also let's you animate the icon in the system tray. The control exposes the following events: MouseMove, MouseDown, Click and DoubleClick events. MouseUp event is not exposed because as far as the tray icon is concerned it is the same as Click event.
The control has the following methods: Start, Modify and Remove. As you might guess Start tells the conrol to show the tray icon. Modify makes whatever modifications you need like changing the icon or tooltip. Remove gets rid of the system tray icon.
Supplied with the downloadable control is demo program that shows how to create a simple tray icon (1 line of code), modify it (2 lines of code), remove it (one line of code), setup an animation, stress test the entire system tray and other goodies
Download TrayIconControl.zip
Updated on 11-05-2000. Thanks to Peter Smith for pointing out a typo in constants and a bug with
application focus in the MouseMove event.