How to show Pop up menu ?

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
 
R

rowe_newsgroups

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
 
M

Mr. Arnold

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. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top