----------------------------------------------------------------- This control has been distributed, with permission of the author by vbweb.co.uk Please direct comments or queries to [email protected] ----------------------------------------------------------------- This control lets you add your program to the system tray, with only one line of code! 'before using this code you need to set the picture property of the control 'to the icon you want displayed in the system tray trayIcon.Add 'where trayIcon is the name of the control ------------------------------------------------------------------ Basic Usage - Draw the control onto the form. It is hidden (you don't see it at run-time.) - name it tryIcon (or whatever) - Set the Picture and ToolTipText properties. Picture: the icon that is shown in the tray ToolTipText: the text that is shown when the mouse hovers. - To show the icon in the system tray, call the Add method - To remove the icon in the system tray, call the Remove method. You don't need to call the Remove method when your application quits... this will be done automatically. That's it! ------------------------------------------------------------------ More Advanced Usage... - To show a popup menu, insert the following code in the MouseUp event, where mnuTray is the popup menu you want to display. There is more information in the VB online help on creating menus. If Button = vbRightButton Then PopupMenu mnuTray End If - There are also LeftDblClick, RightDblClick, MouseDown, MouseUp and MouseMove events. - To restore your program, call the Restore method. If you want to remove the icon from the system tray, call the Remove method too. - You can change the system tray icon by changing the Picture property at runtime, to create an icon similar to the connection monitor. - For more examples, take a look at the example project ------------------------------------------------------------------ If you use this, or have any tips, questions, etc., please email me, so i know how well it's doing in the "real world" - this is my first distributable project. [email protected] -jason ----------------------------------------------------------------- Use this control at your own risk... don't blame us!
Comments