Windows Form->VB->VS2005
I have a panel on an MDI Form. If the user right clicks on a
ToolStripMenuItem, I want the panel to show just to the right of the menu
item. I am using the following code:
Private Sub menItem_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles menItem.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
Dim p As Point = e.Location
p.X = p.X + 300
pnlShortCuts.Location = p
pnlShortCuts.Visible = True
Me.mCurrentMenu = menItem
End If
End Sub
However, what is happening is that it is picking up
e.location
from the top level menu item only, so if it is a sub menu item that the user
is right clicking on, the panel is buried below it.
Does anyone know how I can get the system.drawing.point of the submenu item?
Thanks in advance.
Ed