473,473 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

key press event in .net

I am developing an application in .net. I have various textboxes on the
forms and need to include data validation, or at least restrict the users
input. How do I go about allowing only letters to be entered into a textbox
using the above mentioned event? Further, I want to allow only numbers and
letters to be entered in. I don't want to enter in e.keychar="!" orelse
e.keychar=">", etc. I have converted the contents to uppercase already.

Thanks,
Dave
Jul 22 '05 #1
2 1124
dave wrote:

I am developing an application in .net. I have various textboxes on the
forms and need to include data validation, or at least restrict the users
input. How do I go about allowing only letters to be entered into a textbox
using the above mentioned event? Further, I want to allow only numbers and
letters to be entered in. I don't want to enter in e.keychar="!" orelse
e.keychar=">", etc. I have converted the contents to uppercase already.


Char.IsLetterOrDigit()

--

www.midnightbeach.com
Jul 22 '05 #2
Dave,

In addition to Jon, I use forever for this kind of operations the Key up to
get as much as posible possibilities from the eventargument.

I hope this helps,

Cor
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mukesh | last post by:
Hi I have a datagrid in which i want to capture the key press event and find which row i am in. Tried with the key press event provided by datagrid, but it does not fire. What could be wrong ...
8
by: dixie | last post by:
I want to run an event when I press the Ctl key simultaneously with the K key. How do I achieve this in VBA? dixie
6
by: guoqi zheng | last post by:
In a regular html form, when user press "enter" key, the form will be submitted. However, in ASP.NET web form, a form will only be submitted (post back) when a special button is clicked. Many...
3
by: raj | last post by:
hi, i have one textbox and one save button, i have added attribute at page load event btnSave.Attributes.Add("onclick","return ValidateForm();"); in validationform() ,I have written like this...
6
by: Rado | last post by:
Hello. In Event key_press I write If e.KeyChar = Microsoft.VisualBasic.Chr(127) Then Asci 127 is key DELET. But it doesn't work, when I get other Ascii It's ok. And When I press...
22
by: Ricky W. Hunt | last post by:
First, the subject probably doesn't use the correct terms but I'm not sure what it's called in VB. I'm writing a media player app. The subroutine that handles the "open file" button contains an...
1
by: donald | last post by:
I got a ASP.net text box called textbox1 and a label called label1. When a key is press in a text box i want it to up date the label with what is in the textbox. Label1.Text = TextBox1.Text; ...
1
by: daonho | last post by:
I tried to use javascript to trigger up the button click function when user press enter key from the textbox. This function work fine with a single button click such has login page. However, if the...
1
by: =?Utf-8?B?QXNhZg==?= | last post by:
Hello, I have a Default.aspx page with several controls in a Master Page. When pressing on a Button control Page_Load event is fired on the Default.aspx page and after that the Page_Load event...
3
by: win | last post by:
How to get the keycode press in a web form Vincent
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...
0
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,...
0
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,...
0
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...
0
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...
0
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.