-
Jun 23rd, 2022, 08:32 AM
#1
Thread Starter
New Member
Right-Click Copy and Paste making information disappear inside of MaskEdBox
I am currently maintaining a legacy program that uses VB6. One of its functionalities is to make a new account. In order to make a new account, certain information is necessary in order to generate the new account. This is usually an account number as well as a few other numbers that have certain uses for other stuff within our system. I recently had to change the text boxes used to get this information from the user from CtmEdit boxes to MaskEdBox boxes. This was to allow for copy and paste to work within them. While Ctrl+C and Ctrl+V works just fine in putting the information into the boxes, Right-Click Copy and Paste does not. It will put the information in the box but as soon as the focus is lost from the box where the Paste has happened, the box clears itself. This happens for every single box and seems to be something inherent to the MaskEdBox. I've tried switching every different attribute for the boxes and nothing seems to affect this. Has anyone else run into this issue and have any sort of suggestions on how to fix it?
-
Jun 23rd, 2022, 10:13 AM
#2
Re: Right-Click Copy and Paste making information disappear inside of MaskEdBox
Can you save the pasted data as soon as it is entered, and then restore it when focus is lost?
-
Jun 23rd, 2022, 10:20 AM
#3
Thread Starter
New Member
Re: Right-Click Copy and Paste making information disappear inside of MaskEdBox
Originally Posted by jdc2000
Can you save the pasted data as soon as it is entered, and then restore it when focus is lost?
I cannot. It's still saved to the clipboard but will disappear again if I right-click Paste into the text box. If I happen to add another character (we use numbers for our system), the information will stay. But if I just add a space, it disappears as soon as focus is lost.
-
Jun 23rd, 2022, 12:05 PM
#4
Re: Right-Click Copy and Paste making information disappear inside of MaskEdBox
Does the Changed event for the MaskEdBox fire when you right-click and Paste the data? If it does, you should be able to capture the data from that and restore it.
-
Jun 23rd, 2022, 12:40 PM
#5
Thread Starter
New Member
Re: Right-Click Copy and Paste making information disappear inside of MaskEdBox
It does fire but I'm not sure what logic I should use for right-click Pastes to the textboxes themselves.
-
Jun 23rd, 2022, 12:55 PM
#6
Re: Right-Click Copy and Paste making information disappear inside of MaskEdBox
In the Changed event of the MaskEdBox, capture the data from the control to a variable. Then, you should be able to replace that data in the control on a LostFocus or Exit event for that control.
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
|