Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Regarding Systemtray - contextmenu using Windows Services

Regarding Systemtray - contextmenu using Windows Services

Scheduled Pinned Locked Moved C#
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jmavn
    wrote on last edited by
    #1

    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. :confused:

    Thankfully, jm

    S 1 Reply Last reply
    0
    • J jmavn

      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. :confused:

      Thankfully, jm

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      One Post is enough.

      Regards, Satips.:rose:

      J 1 Reply Last reply
      0
      • S Sathesh Sakthivel

        One Post is enough.

        Regards, Satips.:rose:

        J Offline
        J Offline
        jmavn
        wrote on last edited by
        #3

        Hi, If you know the answer for my question, pls let me know, else where can i find solution? I didnt intendly put the question twice, I clicked submit button two times so it posted the same question twice.

        Thankfully, jm

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups