Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 15th, 2004, 03:37 AM
Authorized User
 
Join Date: Sep 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validation ?

Hi there,

Just a quick problem,

How do i check that a user inputs a number and not a word ?
Is there some kind of boolean function to return true or false depending on the input ?

Thanks

 
Old September 15th, 2004, 08:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

You can force the user to input only numbers by putting this in the Keypress event:

----------------------------------------
If Not e.KeyChar.IsNumber(e.KeyChar) Then
            e.Handled = True
End If
----------------------------------------

J
 
Old September 15th, 2004, 10:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You can use a RegularExpression Validator to only accept digits.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone validation + web form validation morbo Struts 0 August 19th, 2008 04:02 AM
Validation using Validation Framework kalyangvd Struts 1 January 2nd, 2008 06:53 AM
validation mikedeepak ASP.NET 2.0 Basics 0 May 28th, 2007 03:20 AM
Validation g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 January 11th, 2006 06:46 AM
Validation koneruvijay ADO.NET 1 January 6th, 2004 09:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.