|
-
Oct 26th, 2006, 08:30 AM
#1
Thread Starter
Junior Member
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.
-
Oct 26th, 2006, 08:40 AM
#2
Re: VB6 App pastes text twice
Is there any code in the KeyDown or KeyPress event? If so, what?
-
Oct 26th, 2006, 09:18 AM
#3
Thread Starter
Junior Member
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.
-
Oct 26th, 2006, 09:47 AM
#4
Thread Starter
Junior Member
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.
-
Oct 26th, 2006, 12:39 PM
#5
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.
-
Oct 26th, 2006, 01:35 PM
#6
Junior Member
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
-
Oct 26th, 2006, 01:42 PM
#7
Hyperactive Member
Re: VB6 App pastes text twice
 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.
-
Oct 26th, 2006, 02:01 PM
#8
Thread Starter
Junior Member
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.
-
Oct 26th, 2006, 02:06 PM
#9
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.
-
Oct 26th, 2006, 02:29 PM
#10
Member
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.
-
Oct 26th, 2006, 03:06 PM
#11
Re: VB6 App pastes text twice
Do you have this problem on all your vb projects or only on this project?
-
Oct 26th, 2006, 03:56 PM
#12
Thread Starter
Junior Member
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.
-
Oct 26th, 2006, 04:24 PM
#13
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|