Private Sub txtNo_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtNo.KeyPress
If (e.KeyChar < "0"c OrElse e.KeyChar > "9"c) AndAlso e.KeyChar <> ControlChars.Back Then
txtNo.Focus()
e.Handled = True
Else
e.Handled = False
End If
End Sub
참고로 MSDN에는 "How to: Create a Numeric Text Box" 라는 것도 있다.
Posted by shiftkey


