StatusBar ContextMenu Position
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have created a TrayItem that exists in the StatusBar; i use it to notify the user of activity via the the balloon notifications. I know want it as the source of an AboutBox, which I want via a right-click context menu as is traditional.
I have the following:
Snippet
...
trayItem.MouseDown += TrayItem_MouseDown; } return trayItem; } } private static void TrayItem_MouseDown(object sender, StatusBarMouseDownEventArgs e) { if (e.Button == WinForms.MouseButtons.Right) { WinForms.ContextMenu contextMenu = new WinForms.ContextMenu(); WinForms.MenuItem about = new WinForms.MenuItem("About..."); contextMenu.MenuItems.Add(about); trayItem.DisplayContextMenu(contextMenu, new Point(e.X, e.Y)); } }
Which I have found scouring the internet. And it does create and display my context menu with About option.
However, it displays it in relation to the origin at top left corner(ish) of the whole status bar, when the StatusBarMouseDownEventArgs X and Y values are in relation to the top left of the TrayItem "window".
What am I missing?
Secondly, the Autodesk.AutoCad.Windows namespace has it's own menu classes but DisplayContextMenu demands a System.Windows.Forms class, so the context menu will not keep the look and feel of AutoCAD.
If anybody knows their way around this area, that would be incredibly stress reducing for me.
Thanks.