-
Visual C# 使用键盘控制窗体的移动
Visual C#使用键盘控制窗体的移动,创建窗体对象,设置窗体接收按键事件,定义一个标识窗体的变量,判断按键类型,判断后关闭本窗体。
private void Form1_Load(object sender, EventArgs e)
{
Frm_Main form1 = new Frm_Main();//创建窗体对象
form1.KeyPreview = true;//设置窗体接收按键事件
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
Point point = this.Location;//定义一个标识窗体的变量
switch (e.KeyData)//判断按键类型
{
case Keys.Up://当按键为上方向键时
point.Y -= 2;
break;
case Keys.Down://当按键为下方向键时
point.Y += 2;
break;
case Keys.Right://当按键为右方向键时
point.X += 2;
break;
case Keys.Left://当按键为左方向键时
point.X -= 2;
break;
case Keys.Escape://当按键为Esc键时
this.Close();//关闭本窗体
break;
default: break;
}
this.Location = point;
}
- 2022-03-13 23:48:13下载
- 积分:1
-
tutorial_lssvr1.5
The document is a introduction o ls-svm1.5. It is easy to learn and very useful!
- 2013-12-06 20:53:48下载
- 积分:1
-
任天堂gba平台的一个游戏demo,希望对大家有所帮助
任天堂gba平台的一个游戏demo,希望对大家有所帮助-Nintendo gba platform a game demo, hope to help everyone
- 2022-03-22 21:12:30下载
- 积分:1
-
yuanbaozhuceji
数学建模常用的仿真方法 元胞自动机 常用的仿真说明(it is the simulation in mathmatic model)
- 2010-02-02 00:03:59下载
- 积分:1
-
这是和BCH码有关的源程序,前面提交过turbo码了,所以很有必要再加些BCH码的了,呵呵...
这是和BCH码有关的源程序,前面提交过turbo码了,所以很有必要再加些BCH码的了,呵呵 -This is a BCH code and related source code, submitted in front of turbo code, so it is necessary together with some of the BCH code, huh, huh
- 2023-04-17 08:25:04下载
- 积分:1
-
一个基于TURBOC2的俄罗斯方块学习软件,
附带有TURBOC2程序,
一个基于TURBOC2的俄罗斯方块学习软件,
附带有TURBOC2程序,-Based on the Russian box TURBOC2 learning software, comes with TURBOC2 procedures,
- 2022-03-04 16:43:40下载
- 积分:1
-
gs
说明: 对控制系统各组成部分的控制规律进行分析和数学抽象,建立局部数学模型,得到一些典型的控制环节。复杂系统是由典型控制环节组成的。(Control system of the various components of the control law analysis and mathematical abstraction, the establishment of local mathematical model, some aspects of a typical control. Complex system is composed of a typical control links.)
- 2008-10-20 10:13:13下载
- 积分:1
-
运放设计的一些注意点,如何实际一个稳定的运放的一些小技巧...
运放设计的一些注意点,如何实际一个稳定的运放的一些小技巧-OPAMP design point some attention to how real a stable OPAMP some tips
- 2022-02-13 23:16:07下载
- 积分:1
-
PF
说明: 学习粒子滤波的简单实例 先把原理看明白 再逐行看代码很简单(a simple example of particle filtering)
- 2019-03-29 00:29:17下载
- 积分:1
-
driverdev_src2
Driver IOCTL Demo Working
- 2020-06-19 00:20:02下载
- 积分:1