วันพฤหัสบดีที่ 17 มิถุนายน พ.ศ. 2553

TextBox : Input ตัวเลขเท่านั้น



Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress

If Asc(e.KeyChar) <> 13 And Asc(e.KeyChar) <> 8 Then

If Not IsNumeric(e.KeyChar) Then

MessageBox.Show("กรุณาใส่ตัวเลขเท่านั้น !")

e.Handled = True
End If

End If
End Sub

ไม่มีความคิดเห็น:

แสดงความคิดเห็น