当用户在按钮上按回车键(而不是鼠标单击按钮)时,是否有一种简单的方法来取消单击事件?
我试过:
private void button3_Click(object sender, EventArgs e)
{
KeyEventArgs ke = e as KeyEventArgs;
if (ke != null)
{
if (ke.KeyCode == Keys.Enter)
{
return;
}
}
}
但 ke 为空