473,769 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Prevent Pasting invalid data in Textbox [ C# 2.0 ]

2 New Member
Hi,

Currently we have a text box which takes only Numbers. but using control keys and mouse we are able to paste string which has invalid data (i.e. !!@nmbdnm). So how can I restrict the pasting of invalid data on the text box while it should allow numeric strting to be pasted.
Aug 10 '07 #1
2 2132
Chinmay1985
2 New Member
Also The application is c# windows
Aug 10 '07 #2
piercy
77 New Member
you can probably set up a on paste event and the add your validation to it. im not sure how but can probably be done.
Aug 10 '07 #3

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

Similar topics

2
2153
by: ccll20022000 | last post by:
Just curious. I am writing a description for a site I want developers to build (mostly in flash) I was wondering if it is possible to prevent pasting into a field Thanks! ccll20022000
3
12924
by: Michael Shell | last post by:
Greetings, Consider the XHTML document attached at the end of this post. When viewed under Firefox 1.0.5 on Linux, highlighting and pasting (into a text editor) the <pre> tag listing will preserve formatting (white space and line feeds). However, this is not true when doing the same with the <code> tag listing (it will all be pasted on one line with multiple successive spaces treated as a single space) despite the fact that...
7
17879
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm able to encrypt and then decrypt data okay as in the following code: // encrypt the data // Encryptor enc = new Encryptor(EncryptionAlgorithm.TripleDes); byte key = Encoding.ASCII.GetBytes("0123456789012345");
1
1092
by: Phill. W | last post by:
(Apologies if I've missed the answer someplace else, but ... ) Is it possible in "intercept" the actions of the standard (Cut'n'Paste) context menu provided by a TextBox (or derived class thereof) to manipulate the data going to and/or from the Clipboard? Short of completely recplacing the standard one with a Context menu of my own, I can't find any way of doing this. TIA,
14
2348
by: Ed Jay | last post by:
On a multi-textbox form, linked to an external js, I use onBlur to call: function chkNum(cellname) { var str = document.getElementById(cellname).value.toString(10); if (str < 28 || str > 36) {alert("Temperature entered is out of range."); return;} } I enter data into the first textbox and move the cursor to the second textbox. The function is properly called. Since textbox2 is empty, when I
11
2174
by: RobKinney1 | last post by:
Hello, I am looking for a clever way to prevent someone from pasting copied text outside of my app. I know how to monitor the clipboard and get an WM_DRAWCLIPBOARD message when text is stored in the clipboard... If only I could detect some kind of outgoing message that the clipboard is about to paste, then I could check to see if my app is currently in focus and allow/deny as necessary.
6
4043
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!
5
1513
by: rn5a | last post by:
A Web Form has a TextBox within a DataGrid wherein users are expected to enter only whole numbers. It should be validated so that the TextBox doesn't remain blank or any non-numeric data is entered in the TextBox. If the TextBox doesn't get validated, I want to display messages to the user which should be as precise as possible for the user to easily identify where he erred. This is how I did it: ...
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??
0
9579
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
10038
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
9987
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
9857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
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
5294
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...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3558
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.