Wek
unread,May 10, 2008, 12:40:48 PM5/10/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Well, I think you can adjust the menu by the mouse position. You get
the mouse position (normally when the ContextMenu is called, the mouse
is over the SystemTray icon), and then you show the menu in this
position, like this (sorry, some parts are writen in VB, I don't know
C#)
First you've to add a EventHandler:
AddHandler NotifyIcon1.MouseClick, AddressOf ShowMenu
The EventHandler points at this function
void ShowMenu(System.Object sender,
System.Windows.Forms.MouseEventArgs e)
{
ContextMenu.Show(e.X(), e.Y())
}
On 8 mayo, 12:44, "adityo dwiarto" <
adityodwia...@gmail.com> wrote:
> hi all,
>
> I have created a NotifyIcon with my application, when I right-click on the
> SystemTrayIcon, a menu appears on upper right-hand-side of the screen.
> though the menu strip shows, unfortunately I can only adjust it by
> *(x, y)*position to the screen, and not relative to the SystemTray
> postion
> I want it to be shown as how a ContextMenu usually does, right above the
> SystemIconTray.
>
> notifyIconTray.MouseClick += delegate
> {
> //notifyIconMenuStrip.Show(1024, 768); //<-- this
> notifyIconMenuStrip.Show(1024, 768);
> };
> it says:
> void ToolStripDropDown.Show(*Control control,* Point
> position)
> .
> * control:* The control (typically, a
> System.Windows.Forms.ToolStripDropDownButton) that is the reference point
> for the System.Windows.Forms.ToolStripDropDown position. .
>
> Ca n anybody give me a tip?