c#键盘事件,我的程序没反应啊
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace 123{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//textBox1.Text = "你按下了〈Enter〉键";
}
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter)
textBox1.Text = "你按下了〈Enter〉键";
}
}
}
[解决办法]