|
-
August 20th, 2001, 11:15 PM
#1
Context Menu on Richtextbox
On Richtextbox control, when I click right mouse button, default context menu will be displayed.
Please help me that : Can I change default menu ?
If yes, How to do that ?
Thank you in advance.
-
August 21st, 2001, 01:17 AM
#2
Re: Context Menu on Richtextbox
You can't change the default, but there is a workaround. In the MouseUp event of the texbox, check to see if the right button is clicked, then set the Enabled property to false, and then back to true. this way, the popup will not show up, then you can show your own.
private Sub RichTextBox1_MouseUp(Button as Integer, Shift as Integer, x as Single, y as Single)
If Button = 2 then
RichTextBox1.Enabled = false
RichTextBox1.Enabled = true
Popupmenu mnuMyPopup
End If
End Sub
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
August 21st, 2001, 03:37 AM
#3
Re: Context Menu on Richtextbox
Your idea is good. Thank you.
But I see that the default menu still shows after my menu.
-
August 21st, 2001, 04:13 AM
#4
Re: Context Menu on Richtextbox
I found out this way :
private Sub rtfText_MouseUp(Button as Integer, Shift as Integer, x as Single, y as Single)
If (Button = 2) then
rtfText.AutoVerbMenu = false
PopupMenu mnuMyContext
End If
End Sub
Please comment!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|