Results 1 to 4 of 4

Thread: Could be Quite a Challenge.......

  1. #1

    Thread Starter
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425

    Talking

    K, here's my problem.

    I have a standard edit menu in my application (Cut, Copy, Paste, etc...) with standard ShortCut keys assigned via the menu editor. When the user presses Ctrl+V to paste text, the application pastes the text twice due to Ctrl+V being a Windows Shortcut and also defined in the menu. This doesn't happen in a normal textbox, but I'm using a Rich Text Box which I can't change. How can I trap and stop one set of "Ctrl+V" so the text is only pasted once? Someone suggested removing the code from behind the menu, but I need the menu to be useable as well...Here is the code I have for the menu item:

    Code:
    frmMain.ActiveForm.rtbText.SelText = Clipboard.GetText
    If you can help me with this, I will be eternally grateful!

    TIA!!!

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Hahum... why don't you just remove the shortcut key???

    if you really want to keep it you can maybe intercept the WM_PASTE message but I think that would be too much hassle...
    or you can check if the text before the text you're going to paste is the same as the text you're going to paste...
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    Hyperactive Member CyberSurfer's Avatar
    Join Date
    Aug 2000
    Location
    Old London Town
    Posts
    425
    I had thought of that, but I'd like to keep it if only for appearances sake...If no-one can figure this one out, I'll remove the shortcut key...

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Sure we can figure it out, but it would be alot hassle...

    just add some spaces in the caption of the menu and type CTRL+V after it and the appearance problem is gone as well as the programmaticle prob.
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width