473,790 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

88 New Member
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 2383
snowwwolf
28 New Member
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 Recognized Expert Expert
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 .CausesValidati on 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
2148
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 appear as for example with the key of the menu (key on right side completely which precedes Ctrl) combined with the key Enter. Exist there a means of preventing this menu to appear even if it means to show a msgbox for saying that this key is...
2
1933
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 / listbox / datagrid where the cursor is. Is that possible? C# must know where the cursor is. Do you agree. I can't find this out.
17
5485
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 problem where a user (and me it has to be said) just either highlights the email address with their mouse (or Ctrl-A) and then Ctrl-C, Ctrl-P (or right-click copy, right-click paste) into the next field down.
2
3040
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 and outside of its intended boundries. Is there any way to prevent this (maybe to explcitly set the size of the textfield?)
6
4044
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 can paste anything into a textbox, even if (maybe) another shortcut for Pasting has been defined? Thanks in advance!
10
2483
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 characters--> <---75 characters-->
2
2290
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 internet since I guessed someone would have faced this problem before but of no avail. Do we have pointers on how I should go about doing this??
2
1870
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 though I chose the Cursor property of the richtextbox to be "No" but when I run the application I can still click on the RTB and got a Ibeam cursor among my text. Is there a way to prevent a user being able to click on the text and get the ibeam...
3
5299
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 unicode=e.charCode? e.charCode : e.keyCode if (unicode!=8){ //if the key isn't the backspace key (which we should allow) if (unicode<48||unicode>57) //if not a number return false //disable key press
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3707
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.