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 键盘事件
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_KeyPress(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
textBox1.Text = "你按了Enter键";
}
}
}
}
运行程序后 用鼠标点击了窗体,按Enter键后,textBox1控件没有任何反应!!!
请问是问什么?? |
|