숫자만 입력받는 TEXTBOX 만들기

숫자만 입력 + BackSpace
 
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" 라는 것도 있다.
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by shiftkey

2008/11/11 18:50 2008/11/11 18:50
, , ,
Response
No Trackback , No Comment
RSS :
http://shiftkey.org/rss/response/172


블로그 이미지

Shiftkey가 살아가는 이런 저런 이야기......

- shiftkey

Notices

Archives

Authors

  1. shiftkey

Calendar

«   2012/05   »
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Site Stats

Total hits:
161237
Today:
18
Yesterday:
243