i want to insert only integer value from front end.
Example- i have a textbox1 in a window form. i want to insert only price in integer. if i write a string value in it, it display a msg to please insert correct value.

Handle the KeyPress event of TextBox control.

Private Sub TextBox1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If Not Char.IsDigit(e.KeyChar) Then e.Handled = True
    End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.