catch for letters
Visual Basic
3
Posts
2
Posters
0
Views
1
Watching
-
-
Try the keypress event from the text box as below:
Private Sub txtTitleLevel_KeyPress(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles txtTitleLevel.KeyPress If (e.KeyChar >= "0" And e.KeyChar <= "9") Or _ e.KeyChar = Chr(8) Then ' Chr(8) mean backspace. e.Handled = False ' Allow user to input numeric value. Else e.Handled = True ' Do not allow user to type character. End If End Sub
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office
-
Try the keypress event from the text box as below:
Private Sub txtTitleLevel_KeyPress(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyPressEventArgs) _ Handles txtTitleLevel.KeyPress If (e.KeyChar >= "0" And e.KeyChar <= "9") Or _ e.KeyChar = Chr(8) Then ' Chr(8) mean backspace. e.Handled = False ' Allow user to input numeric value. Else e.Handled = True ' Do not allow user to type character. End If End Sub
A thousand mile of journey, begin with the first step. APO-CEDC Save Children Norway-Cambodia Office