读书人

c#键盘事件小弟我的程序没反应

发布时间: 2012-11-16 14:12:15 作者: rapoo

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〉键";
}
}
}

[解决办法]

探讨
if (e.KeyChar == (char)Keys.a&&(char)Keys.b)?你要表达的是什么 a和b一起按?
没有这样的 亲

读书人网 >C#

热点推荐