设置TextBox控件属性 ImeMode=Disable ShortcutsEnabled=False VB.NET Private Sub TextBox1_KeyDown(sender As Object, e As KeyEventArgs) Handles TextBox1.KeyDown If e.KeyCode = Keys.Space Then e.SuppressKeyPress = True End Sub C# private void TextBox1_KeyDown(o
Dim Str As String = "" Private Sub txtRecond_KeyUp(sender As System.Object, e As System.Windows.Forms.KeyEventArgs) Handles txtRecond.KeyUp txtRecond.Text = Regex.Replace(txtRecond.Text, "[^0-9]", "") If txtRecond.Text = &quo