473,379 Members | 1,252 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

How to prevent changes in textbox when we use Ctrl+V or Paste using mouse

How to prevent changes in textbox when we use Ctrl+V or Paste using mouse without effecting the previously stored values in the text box.
I want to Prevent the changes in the textbox by using certen conditions, first i use keyascii event to Control it, it is working where the user enter values to by using keyboard. but it is not working when the user copy some values from anoter position and pase it by using mouse.
Jan 18 '07 #1
2 2359
How to prevent changes in textbox when we use Ctrl+V or Paste using mouse without effecting the previously stored values in the text box.
I want to Prevent the changes in the textbox by using certen conditions, first i use keyascii event to Control it, it is working where the user enter values to by using keyboard. but it is not working when the user copy some values from anoter position and pase it by using mouse.
ok, try like below,

1. In Mouse Down Event ,

copy the original value to a variable from textbox.


2. In Mouse Up Event ,

check your value in textbox, if it is incorrect, replace the old value from the variable to textbox.


<X>
Jan 18 '07 #2
Killer42
8,435 Expert 8TB
The Validate event might be of some help. It allows you to prevent the user leaving the control until you're ready (as long as the .CausesValidation property is True).

This is all assuming we're talking about VB6. If it's VB.Net then forget I said anything.
Jan 19 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Raymond H. | last post by:
Hello, I tried for a long time to find a means of preventing the menu of the right button of the mouse to appear in Textbox but without success because I always could found a way of making it...
2
by: Lars E. Nes | last post by:
Hi all. I have a program that copies text to clibboard when the user presses a combination of SHIFT/CTRL and function keys. Now i am trying to automaticly paste that text into the textbox /...
17
by: emma.sax | last post by:
Hi all, I have a form where we would like the user to input their email address twice, to ensure they've typed it correctly, as is found on most sign-ups I'm looking for a solution to the...
2
by: Wongod | last post by:
I'm currently using css to design my website but I've noticed that when I change the font size in firefox (holding ctrl and using the mouse wheel) that the size of my textfield boxes grows bigger...
6
by: HKSHK | last post by:
Hi, I'm developing an application with VB.NET 2003 and I want to forbid pasting into a textbox. The problem is not the context menu, but the Ctrl+V shortcut. How can I prevent that the user...
10
by: garyusenet | last post by:
I have a multiline textbox. The size of the text box should be 75 characters wide, and 5 lines in height like this: - <---75 characters--> <---75 characters--> <---75 characters--> <---75...
2
by: AjitGoel | last post by:
Hi; I need to create a custom textbox control which will not allow a user to paste text from the clipboard. The user has to always type the text into the textbox. I tried searching on the...
2
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using vs2005, .net 2 for a windows application. I have a richtextbox control on my form that I make it readonly. 1. Do I need to make readonly to be false to append text to it? 2. Even...
3
by: GarryJones | last post by:
I found this handy little script on the net that means the user can only press backspace or numbers in form input. <script type="text/javascript"> function numbersonly(e){ var...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.