Creating a popup menu

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to respond to a right-mouse click on a treeview node by displaying a
popup menu next to the node. How would I do that?

Thanks...

Dan
 
Dan said:
I want to respond to a right-mouse click on a treeview node by displaying a
popup menu next to the node. How would I do that?

Thanks...

Dan

Capture the mouseup event. In the eventargs is a property that tells
you which button was pressed.

Chris
 
Chris said:
Capture the mouseup event. In the eventargs is a property that tells
you which button was pressed.

Chris

funny, I was just in that area of code... here's an example:

Private Sub dgCheckBook_Mouseup(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles dgCheckBook.MouseUp

if e.Button = Windows.Forms.MouseButtons.Right Then
....
end if
 
Private Sub treeview1_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles treeview1.MouseUp

If Not Me.tvPlugins.GetNodeAt(New Point(e.X, e.Y)) Is Nothing Then

me.treeview1.ContextMenu = Me.MyContextMenu

else

me.treeview1.contextmenu = nothing



end sub
 
Back
Top