|
-
May 20th, 2000, 02:05 AM
#1
Thread Starter
Fanatic Member
Does anybody know why and/or know a fix for this? Here is the issue:
We have a RTB and set AutoVerbs = False. Then create a menubar with an edit menu and it contains Cut, Copy, & Paste with the normal hotkeys assigned to them. When we call the functions through the hotkeys we get double the cut/copy and double the paste.
Is there any way to shut off the autoverb hotkeys totally? Please help. Megatron, maybe you know this.
-
May 20th, 2000, 07:26 AM
#2
Conquistador
This may not help, but I believe I have seen an example on this web site, for disabling the context menu of a text box.
If this does not work, you might have to use hooks ?
-
May 20th, 2000, 07:43 AM
#3
Thread Starter
Fanatic Member
It is not actually the context menus we are having trouble with. You can get rid of them by setting the AutoVerbMenu property of the RichTextBox to false, but even after you do CTRL+C, CTRL+V, and CTRL+X still work so that when you assign them to shortcut keys for Cut, Copy, and Paste the program will Cut, Copy, or Paste twice.
-
May 25th, 2000, 02:56 PM
#4
Conquistador
well you could probably check, if they are mouse clicking the menu, or using shortcut keys, that means that your program will take car of it, or windows will
-
May 25th, 2000, 04:16 PM
#5
Here are a couple of tricks that doesn't shut off the shortcut keys for the RTFbox but rather for the menus.
First one is to not assign any shortcuts for your menu (I know this sounds stupid but please keep on reading). Instead change the caption of the menu like this:
Code:
mnuEditCopy.Caption = "C&opy" & vbTab & "Ctrl+C"
This will make it look like you have assign a shortcut but you haven't really so when the users presses CTRL+C the RTFbox copies the selected text while the click event of your menu wont be called.
An other trick (that works but isn't that fancy) is to declare a module variable that acts as a flag that you set to True when a user presses the CTRL key.
Code:
Private m_blnCtrlDown as Boolean
Set this value in the KeyDown event of your textbox:
Code:
If (Shift And vbCtrlMask) = vbCtrlMask Then
m_blnCtrlDown = True
End If
You have to set this flag to false in the KeyUp event:
Code:
If (Shift And vbCtrlMask) = vbCtrlMask Then
m_blnCtrlDown = False
End If
Now check for this flag value in the Click event of you menus.
Code:
Private Sub mnuEditPaste_Click()
If m_blnCtrlDown = False Then
'paste routine goes here
End If
End Sub
Good luck!
[Edited by Joacim Andersson on 05-26-2000 at 05:18 AM]
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
|