i need to validate the textbox such that in can accept numbers only but the entered no should be greater than 0 , it can be 0.1 and should be less than 101.
Jump to Post
Subscribe to KeyPress event hander of textBox control and use this code inside of it:
Private Sub textBox1_KeyPress(sender As Object, e As KeyPressEventArgs) 'allows backspace key If e.KeyChar <> ControlChars.Back Then 'allows just number keys e.Handled = Not Char.IsNumber(e.KeyChar) End If End Sub
All 2 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.