我正在使用 c# windows 应用程序,我需要在插入文本框后向数据库输入一些记录。我试过这段代码
private void textBoxItemCode_KeyDown(object sender, EventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
MessageBox.Show("You have entered the correct key.");
}
}
但我在 e.KeyCode 附近遇到错误,所以如何制作