如下:
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;
using JigsawLogic;namespace Jigsaw
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
switch (e.KeyCode)
{
case Keys.A://左移
case Keys.Left:
MessageBox.Show("Test");
break;
case Keys.D://右移
case Keys.Right:
MessageBox.Show("Test");
break;
case Keys.W://上移
case Keys.Up:
MessageBox.Show("Test");
break;
case Keys.S://
case Keys.Down:
MessageBox.Show("Test");
break;
}
} }
}
按下键盘的上下左右键时没有反应
解决方案 »
- HTTP_X_FORWARDED_FOR未将对象引用设置到对象的实例,请问怎么改?
- 紧急求助, scrollbar 不受控制了
- C#读取文件.jpg的问题(IO)
- 100分求 谁有比较漂亮的 DataGridView 风格,WinForm的!
- 请大虾帮忙,我用c#通过web方式打开excel文件然后,关闭文件,释放com对象,但是进程中怎么还出现excel.详细代码.
- 字符串数据类型的对应问题 没分了就10分 help~~~~~~~
- 新手,问在不同类中值的调用问题
- TreeView控件拖动问题
- MM急送分!vs2003的水晶报表出错为“找不到密码或密码无效”,怎么办呢?
- 如何读取Internet时间?
- 关于html转xml格式的正则表达式
- 关于datagridview控件的RowEnter事件
嗯 谢谢 KeyPreview属性改为true后 ADWS键都有反应, 可是上下左右键怎么没反应呢