-
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
-
White_noise_matlab_code
Detailed analysis of white noise in MATLAB
- 2018-12-28 13:45:13下载
- 积分:1
-
VbEx8
This assignment requires you to complete the dynamic drawing components of the Date/Time Control Panel from the previous two programming assignments. In particular, you will be moving the map found in the "Time Zone" tab when the time zone changes and will be drawing a clock face corresponding to the time setting.
- 2008-05-22 20:10:39下载
- 积分:1
-
32 dian
基于nrf52832平台和6轴传感器的欧拉角输出实现(Implementation of Euler angle output based on nrf52832 platform and 6 axis sensor)
- 2018-05-03 19:47:51下载
- 积分:1
-
用Delphi编制的GIS
用delphi编制的GIS,采用MapwinGIS控件,有多个例子,很好有参考价值。
用delphi编制的GIS,采用MapwinGIS控件,有多个例子,很好有参考价值。
用delphi编制的GIS,采用MapwinGIS控件,有多个例子,很好有参考价值。
用delphi编制的GIS,采用MapwinGIS控件,有多个例子,很好有参考价值。
- 2022-01-22 11:45:53下载
- 积分:1
-
把二进制按制按照DEBUG的形式输出到屏幕或文件。
把二进制按制按照DEBUG的形式输出到屏幕或文件。-put by the binary system with DEBUG output in the form of paper or screen.
- 2022-03-19 19:22:55下载
- 积分:1
-
二分法查找
C语言编程学习,使用二分法查找最大/最小数据(C language programming learning, using dichotomy to find the largest / minimum data.)
- 2018-08-16 17:08:30下载
- 积分:1
-
图片遮罩层动画特效
一款使用纯CSS3制作的鼠标滑过图片遮罩层动画特效(A special animation effect using a pure CSS3 mouse to slide over the image mask layer)
- 2019-02-13 11:12:13下载
- 积分:1
-
博世cdr
CDR 文件的格式,博世文件,提供CDR格式的文件说明规范!(CDR file format, BOSCH file)
- 2021-01-02 19:08:57下载
- 积分:1
-
105230318nsga2(三维路径规划)
基于蚁群算法的三维路径规划,亲测可用,欢迎下载。(Ant colony algorithm based three-dimensional path planning, pro test available, welcome to download.)
- 2018-08-28 17:02:57下载
- 积分:1