Is there a way to position a form just above the clicked Notify Icon in windows 7 and windows Vista?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Here is an easier way.
You can get X,Y position of the mouse when the OnClick event is fired. You can also get the taskbar position with somes checks from these objects
Screen.PrimaryScreen.Bounds
,Screen.PrimaryScreen.WorkingArea
.Regarding your comment: "how could i know how is the taskbar positioned?"
Check out the following article which contains a class which exposes a method for retrieving a Rectangle Structure for the tray: [c#] NotifyIcon - Detect MouseOut
Using this class you can retrieve the Rectangle Structure for the tray like so:
Which will provide you with the Top, Left, Right and Bottom coordinates for the tray along with its width and height.
I have included the class below:
Hope this helps.