winform 屏蔽 空格键

private void call_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Space)
{
e.Handled = true;//表示已经处理了键盘消息
}
}

上述代码好像不起作用,下面的可以

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)

{
return true;
}

原文地址:https://www.cnblogs.com/asdyzh/p/9807453.html