N
nic
I'm working on coding my first windows service. I'm trying to use a
NotifyIcon with a context menu for configuration of the form. The icon is
showing up in the taskbar of the system, but the context menu is not
working. Here's my OnStart event handler in the service:
protected override void OnStart(string[] args)
{
m_TrayIcon = new NotifyIcon();
m_TrayIcon.Icon =
new System.Drawing.Icon (@"C:\projects\Icons\toybox\RUBIC01F.ICO");
m_TrayIcon.Text = "Test Service Icon";
//Build the context menu:
m_TrayIcon.ContextMenu= new ContextMenu();
m_TrayIcon.ContextMenu.MenuItems.Add("Something");
m_TrayIcon.Visible = true;
}
Am I missing something here?
Thanks for any help!
Nic
PS if there is a more appropriate group to post this question to, please let
me know.
NotifyIcon with a context menu for configuration of the form. The icon is
showing up in the taskbar of the system, but the context menu is not
working. Here's my OnStart event handler in the service:
protected override void OnStart(string[] args)
{
m_TrayIcon = new NotifyIcon();
m_TrayIcon.Icon =
new System.Drawing.Icon (@"C:\projects\Icons\toybox\RUBIC01F.ICO");
m_TrayIcon.Text = "Test Service Icon";
//Build the context menu:
m_TrayIcon.ContextMenu= new ContextMenu();
m_TrayIcon.ContextMenu.MenuItems.Add("Something");
m_TrayIcon.Visible = true;
}
Am I missing something here?
Thanks for any help!
Nic
PS if there is a more appropriate group to post this question to, please let
me know.