• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

VB 6.0 MaskEdBox 6.0 Copy/Paste with Right Mouse Button!!

Anyone run into this before?

I have two MaskEdBoxes on a form both with the following mask ">CCCCCCCCCC".  I enter some text in the first box, highlight it using the mouse and copy it using the Right Mouse button and clicking on Copy.

I go to the second box and right click then click on paste.  The text is there but when I leave the box the text disappears.
1 Solution

You need to set the property ClipMode = "Exclude Literals"
twardAuthor Commented:
Did you try your answer?  It doesn't work.
It's a very annoying bug (Very simular to the newest IE4 security bug).

The easyest solution would to stop the user from pasting.

Mr. Fixit
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

twardAuthor Commented:
Not really a good answer...  Looked in the Knowledge base and couldn't find anything.  Will put it out there to see if anyone has a better answer...

How do you stop the pasting with the right mouse button anyway?  I saw this one time but can't remember the control or the property I was dealing with.

Another note is that if I do the copy/cut/paste using the Ctrl-V,C,X or Shift-Ins then it works just fine!!
Dim m_inchange As Boolean
Private Sub MaskEdBox2_Change()
    If Not m_inchange Then
        m_inchange = True
        On Error Resume Next
        MaskEdBox2.Text = MaskEdBox2.Text
        m_inchange = False
    End If
End Sub
twardAuthor Commented:
Crazy to have to do things like that but it does work!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now