Regarding Systemtray - contextmenu using Windows Services
-
Hi, I have created a sample Windows Service, in which I want to provide a notify icon on the system tray. I have placed a notify icon and a contextmenustrip on the Service's Designer form, and on the OnStart() method of the Service I have assigned a value to the contextmenustrip property of the notifyicon. The following code snippet is written on the OnStart() event of the service,
**contextMenuStrip1.Items.Add("Login"); contextMenuStrip1.Items.Add("ViewRecentDocuments"); notifyIcon1.ContextMenuStrip = contextMenuStrip1; notifyIcon1.Text = "Notifier"; notifyIcon1.Visible = true;**
After that I have installed the Service in the system, and started the service. The notifyicon get displayed, but while right-clicking on it, contextmenu didnt displayed. Is my code is correct one, if not what change should I do, to make the contextmenu to be displayed on notifyicon's right-click event.. Anyone knows the solution, please reply me.Thankfully, jm