How to do this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sdanda
    New Member
    • Oct 2007
    • 36

    How to do this?

    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....
  • halo combat22
    New Member
    • Oct 2007
    • 24

    #2
    Originally posted by sdanda
    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.

    Comment

    • Torgg
      New Member
      • Dec 2007
      • 41

      #3
      This should do it for you

      [CODE=vbnet] Private Sub TextBox1_KeyPre ss(ByVal sender As Object, ByVal e As System.Windows. Forms.KeyPressE ventArgs) Handles TextBox1.KeyPre ss
      If e.KeyChar.IsNum ber(e.KeyChar) = False Then
      e.Handled = True
      End If
      End Sub[/CODE]

      Torgg
      Last edited by debasisdas; Dec 18 '07, 08:39 AM. Reason: Formated using code tags

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        You could try the MS Masked Edit Control.

        Comment

        • sdanda
          New Member
          • Oct 2007
          • 36

          #5
          Thanks for information.I got it now.

          Comment

          Working...