By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,594 Members | 2,062 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,594 IT Pros & Developers. It's quick & easy.

How to do this?

P: 36
I am working on windows vb.net applications.In My form I created a textbox.But I would like to enter only integer values in this textbox.How to do this"Shall I need to change any property of the textbox.Can anyone help me....
Dec 17 '07 #1
Share this Question
Share on Google+
4 Replies


P: 24
I am working on windows vb.net applications.In My form I created a textbox.But I would like to enter only integer values in this textbox.How to do this"Shall I need to change any property of the textbox.Can anyone help me....
I don't know for vb.net there is a isnumeric( ) function, try searching for that.
Dec 17 '07 #2

P: 41
This should do it for you

Expand|Select|Wrap|Line Numbers
  1.     Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
  2.         If e.KeyChar.IsNumber(e.KeyChar) = False Then
  3.             e.Handled = True
  4.         End If
  5.     End Sub
Torgg
Dec 17 '07 #3

Expert 5K+
P: 8,434
You could try the MS Masked Edit Control.
Dec 18 '07 #4

P: 36
Thanks for information.I got it now.
Dec 20 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.