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

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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel VBA, find a string in a column, update a cell 7 86
Visual Studio 2005 text editor 10 43
How to make an ADE file by code? 11 93
Set email body to html using vbscript 6 49
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

765 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