473,386 Members | 1,803 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,386 software developers and data experts.

Textboxes and Numbers

What is the easiest way to check if the key pressed in a textbox is numeric.

Nov 21 '05 #1
3 1022
Hi,
In the KeyPress event of the TextBox, do: IsNumeric(e.KeyChar)

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:#k**************@TK2MSFTNGP10.phx.gbl...
What is the easiest way to check if the key pressed in a textbox is numeric.


Nov 21 '05 #2
I need to have this done on the keydown event any ideas?
"Shiva" <sh******@online.excite.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi,
In the KeyPress event of the TextBox, do: IsNumeric(e.KeyChar)

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:#k**************@TK2MSFTNGP10.phx.gbl...
What is the easiest way to check if the key pressed in a textbox is numeric.


Nov 21 '05 #3
Sure. In the KeyDown event, have IsNumeric(Chr(e.KeyValue))

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:eO**************@TK2MSFTNGP11.phx.gbl...
I need to have this done on the keydown event any ideas?
"Shiva" <sh******@online.excite.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Hi,
In the KeyPress event of the TextBox, do: IsNumeric(e.KeyChar)

"Michael Turner" <fi*****@m-turner.co.uk> wrote in message
news:#k**************@TK2MSFTNGP10.phx.gbl...
What is the easiest way to check if the key pressed in a textbox is numeric.



Nov 21 '05 #4

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

Similar topics

0
by: blurz | last post by:
Hi, would like to know how to go about validating a a group of textboxes. For example, I have 3 textboxes that will hold a user's different contact numbers. How do I ensure that at least one of...
15
by: crjunk | last post by:
I have 4 TextBoxes on my form that I'm trying to add together to get a grand total. Here is the code I'm using: <SCRIPT LANGUAGE="JavaScript"> <!-- Beginning of JavaScript - function...
13
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and...
6
by: Woody Splawn | last post by:
We have access to Infragistics etc., but we would like to make use of a regular VS textbox so that it accepts only numbers. We have discovered that if you bind an integer field to a textbox, for...
4
by: joanjy86 | last post by:
;) Hi, I met with some problems with my Visual Basic codings...I need to retrieve certain texts or characters from the text file and place it in each different textboxes...How do i start with? :eek:...
2
by: Ole | last post by:
Hi, I'm having 2 textboxes in which I enter binary numbers that must be calculated to a third number that is shown in a third textbox. How do i convert my entered binary number to an e.g an int...
2
by: noosaj | last post by:
Hi, I'm designing a basic sales tax calculator. I'm in a bind here. I am trying to figure out how to prevent the user from inputting anything other than numbers in the textboxes. Obviously,...
0
by: Elmo Watson | last post by:
I've got quite a few textboxes on my page, along with labels, within a table. In these textboxes, I use the onTextChanged event (with autopostback=true) to calculate some formulas, and put the...
1
by: Peirski | last post by:
Hi all Situation: a form containing 10 textboxes with a button to validate those textboxes The user will have to complete these textboxes with numbers from 1 to 10 and each number can only...
16
by: Alexio | last post by:
Am new to javascript. I need to format the currency in the as numbers are entered in textboxes. I can format the currency in the calculations and display in the totals but can not figure out how to...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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,...

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.