contextmenu

  • Thread starter Thread starter Cc
  • Start date Start date
C

Cc

how do I show context menu on richtextbox?

I try select the contextmenu under properties , but still no use do I miss
something. (VS 2005)
 
Hi

First add the ContextMenu on the form and set RichTextBox.ContextMenu
property.
Then write following code.

Private Sub myRichTextBox_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles myRichTextBox.MouseDown
If e.Button = MouseButtons.Right Then
myContextMenu.Show(myRichTextBox, New Point(e.X, e.Y))
End If
End Sub

Hopes this will help.

Sakharam Phapale
 

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

Back
Top