Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

When i right-click my form I want a menu to pop up, with menu items like:

 

Copy

Paste

Cut

 

I probably wouldn't use these commands, but others I would though. So I know I would use the right-click event, but how would I add the menus to that event?

 

 

   Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
       If e.Button = MouseButtons.Right Then
           '???
           MsgBox("This works")
       End If
   End Sub

"Reality is fake, Dreams are for real"
Posted

Add a Context Menu control

 

add your menu items like you do with a standard main menu

 

 

then on the forms property

 

go to Context Menu

 

and select the Context menu u created

  • 5 months later...
Posted

Saw this thread and wondered

 

How would you make it that the context menu will only appear when you click in a treeview Control that is on the form??

 

 

Cire

Trust the Universe

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...