-
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
-
zyqmtj
说明: 生成一个能用LED光源投射出矩形光斑的自由曲面的程序(Generation of freefrom surface point cloud)
- 2020-12-31 09:28:59下载
- 积分:1
-
THis C implelementation of Huffman s algorithm ..
it is good program ..
THis C implelementation of Huffman s algorithm ..
it is good program .. -THis is C implelementation of Huffman s algorithm ..
it is good program ..
- 2022-01-21 18:36:58下载
- 积分:1
-
cmd_proc
cmd proc.pl - A quick and dirty command processor in perl cmd proc.pl - A quick and dirty command processor in perl
- 2010-12-18 22:14:03下载
- 积分:1
-
舵机速度环控制simulink搭建模型
说明: 电机数学模型,仿真用,包含舵机速度环控制,simulink搭建模型,(Motor mathematical model, for simulation)
- 2020-02-01 18:43:42下载
- 积分:1
-
出错处理,空着就可以了 出错处理,空着就可以了
出错处理,空着就可以了 出错处理,空着就可以了-出错处理,空着就可以了出错处理,空着就可以了出错处理,空着就可以了
- 2022-02-10 00:26:57下载
- 积分:1
-
基于PV光伏发电的分布式发电技术
说明: 基于光伏发电的分布式发电技术建模与仿真,提高分布式发电技术的实用性(Modeling and Simulation of distributed generation technology based on photovoltaic power generation)
- 2020-03-31 06:52:06下载
- 积分:1
-
conversion of forest to the corresponding binary tree algorithm
将森林转化为相应二叉树的算法-conversion of forest to the corresponding binary tree algorithm
- 2023-04-26 13:05:04下载
- 积分:1
-
fsk modulation Frequency shift keying (FSK) is the most
common form of digital...
fsk modulation Frequency shift keying (FSK) is the most
common form of digital modulation in the
high-frequency radio spectrum, and has
important applications in telephone circuits.
This article provides a general tutorial on FSK
in its many forms. Both modulation and
demodulation schemes will be discussed
- 2022-08-17 07:12:58下载
- 积分:1
-
新建文件夹
说明: 在实例中实现差分方程和数值积分差分方程 ~ 离散时段上描述变化过程的数学模型(The difference equation and numerical integral difference equation are realized to describe the mathematical model of the change process in the discrete time period)
- 2019-02-23 11:05:31下载
- 积分:1