how to get the icon in system tray when the main window is closed

kanak

Member
Joined
Jan 9, 2005
Messages
17
Programming Experience
Beginner
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
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
add a NotifyIcon control to your form (it'll be in the component tray) add a ContextMenu to your form. on the NotifyIcon set the ContextMenu property to your contextmenu. in the form's CLosing event:

VB.NET:
 e.cancel = true
 me.hide
 notifyicon.visiable=true 'disregard this if the icon is always visible in the tray
 
Top Bottom