Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Numeric value only textbox
Author:
M.V. Lawrence
E-mail:
Click to e-mail author
Submitted:
10/16/2003
Version:
VB.NET
Compatibility:
VB.NET
Category:
Miscellaneous
Views:
33811
It is a very simple coding for entering numeric value in a text box (VB.NET)
Declarations:
Code:
Private Function TrapKey(ByVal KCode As String) As Boolean If (KCode >= 48 And KCode <= 57) Or KCode = 8 Then TrapKey = False Else TrapKey = True End If End Function Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress e.Handled = TrapKey(Asc(e.KeyChar)) End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement