DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Putting an Icon in the System Tray

  1. #1
    Andy Kendall Guest

    Putting an Icon in the System Tray

    Hi,

    I am trying to create and icon in the system tray for a Windows Service I
    have written. I am thinking something along the lines of the SQL Server
    Service manager where you can double click the icon to get a form where you
    can stop/start the service etc.

    I have used the NotifyIcon control, but this seems to need to be on a form
    otherwise the icon in the system tray will not receive mouse events. This is
    fine except that I don't want the form to display on startup.

    Does anyone know how I can either: accomplish this task without the use of a
    form OR programmatically hide a form as soon as it has loaded.


    Thanks in advance,

    Andy K



  2. #2
    PWilmarth Guest

    Re: Putting an Icon in the System Tray


    If you don't need to see the form, but want the notify icon available, you
    can set the opacity of the form = 0; this will make the form invisible, while
    making the icon available. You can then write code to respond to the events
    of the icon. This is the simplest method I know of for accomplishing what
    you want.

  3. #3
    Andy Kendall Guest

    Re: Putting an Icon in the System Tray

    Thanks for that, good suggestion but the Notify Icon only seems to receive
    events when the form which it lives on is the active form.

    which when you can't see it, is quite difficult to ensure


    "PWilmarth" <pwilmarth@msn.com> wrote in message
    news:3da86cf6$1@10.1.10.29...
    >
    > If you don't need to see the form, but want the notify icon available, you
    > can set the opacity of the form = 0; this will make the form invisible,

    while
    > making the icon available. You can then write code to respond to the

    events
    > of the icon. This is the simplest method I know of for accomplishing what
    > you want.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center