Results 1 to 13 of 13

Thread: VB6 App pastes text twice

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    VB6 App pastes text twice

    I've got a large vb6 app that I'm maintaining. When I'm debugging, if I copy text using ctrl + v, it pastes the text twice, but if I right click, it pastes it normally.

    Now I noticed that when I'm using an ie holder in the app, and paste into a web page text box,using the keyboard, it's pasting the text twice.

    I just thought I would throw this out there and see if anybody has experienced this before. Thanks.

  2. #2

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    Re: VB6 App pastes text twice

    There is nothing on the key events. The app is a MDI app. It happens on the child forms. Some of the child forms are ran outside of the MDI, and then it works fine. I think there is win32 api call that's causing the problem.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    Re: VB6 App pastes text twice

    Also, when debugging, if I use the keyboard to step over/into, then it skips to the next line. If I use the buttons in the IDE, then it works.

  5. #5
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: VB6 App pastes text twice

    Have you assigned Ctrl+V to any Paste menu item? If you have when pressing Ctrl+V in a textbox the textbox itself will first process the shortcut and paste the text from the Clipboard and then VB will run the Paste code you have in the Click event of the menu. This of course will paste the text twice.

  6. #6
    Junior Member
    Join Date
    Oct 2006
    Posts
    20

    Re: VB6 App pastes text twice

    Go to the key press event
    ask if the keyascii correspondes to "v" and ctrl is being pressed, and if so, keyascii=0

    because textboxes already include a ctrl+v, and if you add another one, then bot occur, so with that code I think you prevent the original textbox's from happening

  7. #7
    Hyperactive Member BrendanDavis's Avatar
    Join Date
    Oct 2006
    Location
    Florida
    Posts
    492

    Re: VB6 App pastes text twice

    Quote Originally Posted by Joacim Andersson
    Have you assigned Ctrl+V to any Paste menu item? If you have when pressing Ctrl+V in a textbox the textbox itself will first process the shortcut and paste the text from the Clipboard and then VB will run the Paste code you have in the Click event of the menu. This of course will paste the text twice.
    This sounds like the obvious answer. But then again, I've created a few MDI applications that use the ctrl-v paste code in a menu and it hasn't done this. Mainly because of the way it was setup, more than likely. If he has the menu even on the main(parent) window menu, it shouldn't be a problem(it never was for me). If he has it in the child window, it may present a problem.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    Re: VB6 App pastes text twice

    No I haven't. Also, it doesn't paste the text twice on any of the vb forms. It only happens while debugging (it processes paste, as well as step-thru, twice) and on a web page in an ie holder.

  9. #9
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: VB6 App pastes text twice

    Then check your activate events.. that's what's being fired when you step through code and alternate from the VB IDE and the app form.

  10. #10
    Member
    Join Date
    Aug 2004
    Posts
    35

    Re: VB6 App pastes text twice

    I'm going to hazard a guess that in debug mode that pressing ctrl+v fires the windows copy function and then fires the code copy function. Your window is getting the copy message twice.

  11. #11
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: VB6 App pastes text twice

    Do you have this problem on all your vb projects or only on this project?
    CS

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    Re: VB6 App pastes text twice

    It's only on this project. I have a bunch of components run both in this MDI app and in another exe.

    It only occurs when components are in the MDI app. It is not specific to any form and has nothing to do with any events on the forms in the component.

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Location
    Midwest
    Posts
    27

    Re: VB6 App pastes text twice

    I've determined what is causing the problem, but am not sure how it's causing the problem.

    This app uses a custom control that docks a window to it's parent form. Right after the component is initialized is when the the double pasting occurs. The control is several years old and I don't have access to the code.

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