2
如何在VB.NET/Visual Studio 2008中允許空格鍵和退格鍵?如何在VB.NET/Visual Studio 2008中允許空格鍵和退格鍵?
示例代碼:
Private Sub txtname_KeyPress(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) _
Handles txtname.KeyPress
If e.KeyChar < "A" Or e.KeyChar > "z" And e.KeyChar <> ControlChars.Back Then
e.Handled = True
txtname.Clear()
Else
End If
End Sub
你的問題是什麼? – j0k