kanak Posted January 16, 2005 Posted January 16, 2005 hi all i want when my window form get closed it shud place a icon on the system tray .. can anyone tell me how to do it ... and also how to add the menu when the user right click at the icon ... i dont want it to display on the taskbar but as a icon in the system tray Quote
3xodus Posted January 16, 2005 Posted January 16, 2005 (edited) hi all i want when my window form get closed it shud place a icon on the system tray .. can anyone tell me how to do it ... and also how to add the menu when the user right click at the icon ... i dont want it to display on the taskbar but as a icon in the system tray Hi For the systemtray icon, use the NotifyIcon control, and set the visibility property to false if you don't want the icon to be in the system tray at all times. In the form_Closing event of your form, put code something along the lines of: e.Cancel = True Me.Hide() NotifyIcon.Visible = True This will hide the form, and make the sys tray icon visible. As for the menu, look at the ContextMenu control - create the menu and remember to add it to the system tray icon (by using the NotifyIcon's ContextMenu property ;) Hope this helps :) Edited January 16, 2005 by 3xodus Quote Using: Visual Studio 2005/08 Languages: C#, Win32 C++, Java, PHP
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.