How to show Pop up menu ?

  • Thread starter Thread starter fniles
  • Start date Start date
F

fniles

In my VB6 program I have a Grid control, and when I right click on the grid,
I will show a pop up menu.
In VB.NET 2003 how can I show a pop up menu on a control ?

This is the code from VB6
Private Sub TDBGridWorking_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = 2 Then
frmDesk.PopupMenu mnuedit
End If
End Sub
 
In my VB6 program I have a Grid control, and when I right click on the grid,
I will show a pop up menu.
In VB.NET 2003 how can I show a pop up menu on a control ?

This is the code from VB6
Private Sub TDBGridWorking_MouseDown(Button As Integer, Shift As Integer, X
As Single, Y As Single)
If Button = 2 Then
frmDesk.PopupMenu mnuedit
End If
End Sub

You create a ContextMenuStrip and then set it as the value of the
control's ContextMenuStrip property.

Thanks,

Seth Rowe
 
fniles said:
In my VB6 program I have a Grid control, and when I right click on the
grid, I will show a pop up menu.
In VB.NET 2003 how can I show a pop up menu on a control ?

This is the code from VB6
Private Sub TDBGridWorking_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
If Button = 2 Then
frmDesk.PopupMenu mnuedit
End If
End Sub

The form as a Context Menu Strip. The other controls have Context Menu as
well.

http://www.codeproject.com/vb/net/ContextMenuVBNET.asp

Anything you're thinking about doing, the Code Project has it, my examples
tool of choice. :)
 
Back
Top