06-12-19, 04:31 PM
تقوم بوضع هذا الكود في الموديل
كود :
Public Sub onlyNumber(ByVal e As KeyPressEventArgs)
Select Case e.KeyChar
Case "0" To "9", ".", ControlChars.Back
e.Handled = False
Case Else
e.Handled = True
End Select
End Subداخل التيكست بوكس KeyPress
كود :
Private Sub TextBox1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles TextBox1.KeyPress
onlyNumber(e)
End Sub
