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 Textbox - Defect Fixed Code
Author:
Gehan Fernando
E-mail:
Click to e-mail author
Submitted:
3/6/2011
Version:
VB 2008
Compatibility:
VB 2008, VB 2010
Category:
Controls
Views:
8239
Numeric Text box Control, without creating OCX - Defect Fixed Code
Declarations:
Declarations : ' Create Windows Application [ VB.net ] ' Add Text box Control ' Added Following code for the Key-press event ' For More Refer Following URL ' http://www.syncfusion.com/faq/windowsforms/faq_c94c.aspx ' http://www.java2s.com/Tutorial/VB/0260__GUI/DisableTextBoxContextMenu.htm
Code:
Dim digit As Char = e.KeyChar If Char.IsDigit(digit) Or digit = ChrW(Keys.Back) Then e.Handled = False Else If TextBoxNumeric.Text.Contains(".") = True Then e.Handled = True Else If Char.IsLetter(digit) Or Char.IsWhiteSpace(digit) Then e.Handled = True Else e.Handled = False End If End If End If
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement