ContextMenuStrip in RichTextBox
How can I show ContextMenuStrip in RichTextBox when I highlight a word and right click the mouse?
The code below only show the ContextMenuStrip when I double click in the RichTextBox
Code:
Private Sub rtb_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rtb.MouseDoubleClick
ContextMenuStrip1.Show(MousePosition, Right)
End Sub
Thanks
Re: ContextMenuStrip in RichTextBox
u can mouse up event for this purpse
Code:
If e.Button = Windows.Forms.MouseButtons.Right Then
ContextMenuStrip1.Show(MousePosition, Right)
Re: ContextMenuStrip in RichTextBox
Re: ContextMenuStrip in RichTextBox
Good if ur problem solved
last time i did mistakes
u can do it as also
Code:
Private Sub RichTextBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles RichTextBox1.MouseUp
If e.Button = Windows.Forms.MouseButtons.Right Then
ContextMenuStrip1.Show(RichTextBox1, New Point(e.X, e.Y))
End If
End Sub
Re: ContextMenuStrip in RichTextBox
Quote:
Originally Posted by
imname
How can I show ContextMenuStrip in RichTextBox when I highlight a word and right click the mouse?
The code below only show the ContextMenuStrip when I double click in the RichTextBox
Code:
Private Sub rtb_MouseDoubleClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles rtb.MouseDoubleClick
ContextMenuStrip1.Show(MousePosition, Right)
End Sub
Thanks
Can you help me use this code for a spellchecker suggester?
Re: ContextMenuStrip in RichTextBox
How can I use this code for a spell checker suggester?
Re: ContextMenuStrip in RichTextBox
Can you help me use this code for a spellchecker suggester?