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

Posted on 1998-11-20
Last Modified: 2008-02-01
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.
Question by:tward
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1445884

You need to set the property ClipMode = "Exclude Literals"

Author Comment

ID: 1445885
Did you try your answer?  It doesn't work.

Expert Comment

ID: 1445886
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.


Author Comment

ID: 1445887
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!!
LVL 13

Accepted Solution

Mirkwood earned 100 total points
ID: 1445888
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

Author Comment

ID: 1445889
Crazy to have to do things like that but it does work!


Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb6 connector to SQL Server 2 42
Exit a vb6 apps when a calling it apps closes 15 58
Add and format columns in vb6 7 72
VBA: copy range dynamically based on config sheet v2 3 55
Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question