Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

I need my VB.NET application to start in the system tray and when the user hovers his mouse over it, it displays the info that is on the form.

Posted on 2005-03-28
8
Medium Priority
?
986 Views
Last Modified: 2010-05-18
I am building a small application that tells what user is hooked to the computer, IP address, OS version etc and need for it to start in the system tray.   (Maybe just hide it on startup...)  But i also need for a small menu to display above the icon when the mouse is hovering over it that displays the aforementioned information.  How can this be done?  I also need for a user to be able to right click on it and either maximize it (show the form with the info) or close the program.  Think i have that worked out though...  Thanks in advance!

This is my first question i have asked, is the difficulty too high/low?  too many questions in one?

Cheers!
0
Comment
Question by:TheRookie32
  • 5
  • 3
8 Comments
 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 13649410
what you need are two controls:
NotifyIcon -- to display icon in the task bar
ContextMenu -- to display the menu after one right click on that icon

Heres a small app. You can have a look at this example :
http://www.codeproject.com/csharp/trayiconmenu01.asp
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 13658204
How can i get the app to start in the task bar?  Then be able to open it up or close it from the taskbar.
0
 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 13658846

Add a NotifyIcon Control from the toolbar to the form (notifyIcon1)
Add a ContextMenu Control from the toolbar to the form (contextMenu1)
Set your main Form's ShowInTaskBar Property to False
Set notifyIcon1.ContextMenu Property to contextMenu1 either from the IDE or from code
Set notifyIcon1.Text Property to the Text Property of your main Form
Set a propert Icon for the notifyIcon1.Icon Property
In the DoubleClick Event of  notifyIcon1 write:

            Me.ShowInTaskbar = Not Me.ShowInTaskbar
            If Not Me.ShowInTaskbar Then
                  Me.Visible = False
                                 Else : Me.WindowState = FormWindowState.Normal
            End If

In your form's load event write:
Me.WindowState = FormWindowState.Minimized


0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 13658922
Have fun with double clicking on the notify icon in the task bar :)
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 13667072
Thanks for your help!  Any idea how to get a small menu to appear over the icon if the user has their mouse over it that displays the forms info?  Also can it be opened straight to the taskbar and not minimized on startup?

Cheers!
0
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 1500 total points
ID: 13669501
>>Any idea how to get a small menu to appear over the icon if the user has their mouse over it that displays the forms info?
a menu cant be displayed (only text can be displayed)... you to display a menu on right click by adding menuitems to the contextmenu that you have added earlier.

>>Also can it be opened straight to the taskbar and not minimized on startup?
Set your main Form's ShowInTaskBar Property to True

In your form's load event write:
Me.WindowState = FormWindowState.Normal
0
 
LVL 6

Author Comment

by:TheRookie32
ID: 13673281
How could i get teh text to displlay when the user hovers his mouse over the icon?  
0
 
LVL 19

Expert Comment

by:Fahad Mukhtar
ID: 13677889
Set notifyIcon1.Text Property to the Text Property of your main Form or any other Text
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Integration Management Part 2
Screencast - Getting to Know the Pipeline
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question