Richtextbox right click popup menu?


  • I am looking for code to insert into the Richtextbox1_mousedown event that will check to see if the right mouse button was clicked, and if so popup a menu.

    Just like in VB6:
    PopupMenu mnuEdit

    I can't seem to find it.

    Please help.

    You can email me at, thank you.
    Friday, January 20, 2006 6:43 PM

All replies

  • Look for the ContextMenu property
    Friday, January 20, 2006 7:16 PM
  • If e.Button = Windows.Forms.MouseButtons.Right Then

    Me.ContextMenuStrip1.Show(Me.RichTextBox1, New Point(e.x, e.y))

    End If

    you also have this to work with:

    Me.RichTextBox1.ContextMenuStrip = Me.ContextMenuStrip1

    Friday, January 20, 2006 7:16 PM
  • That worked!

    I spent the last two hours trying to get it to do that, unbelievable.

    Thank you very much!

    Friday, January 20, 2006 7:27 PM