Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the location of the icon in the system tray

I have a NotifyIcon control that appears in the system tray. How can I find the location (x, y) of the icon on the screen?

Thanks

like image 419
AngryHacker Avatar asked Nov 07 '08 17:11

AngryHacker


1 Answers

Actually you can do this, here is code that shows you how and much more.

In any Mouse Event from NotifyIcon, simply look at Control.MousePosition, this contains the (x,y) of the mouse. The same can be done to position a ContextMenu on a form/control exactly where the form/control was clicked using these (x,y) values.

A good example of both of these is here:

More Here: http://code.msdn.microsoft.com/TheNotifyIconExample

like image 178
2 revsTheUberOverLord Avatar answered Oct 01 '22 13:10

2 revsTheUberOverLord