【C#】C#winform 双击/按"F12"键全屏,按"Esc"键退出
来源:互联网 发布:骁龙835支持5g网络吗 编辑:程序博客网 时间:2024/04/26 19:31
private void Lottery_DBClick(object sender, EventArgs e)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;// 设置边框为 None
this.WindowState = FormWindowState.Maximized;// 最大化
this.TopMost = true;// 置顶
this.KeyPreview = true;// 允许窗体先收到键盘事件
this.KeyUp += new KeyEventHandler(Lottery_KeyUp);// 允许窗体先收到键盘事件
this.Show();//显示 Form
}
private void Lottery_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)//"Esc"按键退出全屏
{
this.WindowState = FormWindowState.Normal;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
}
if (e.KeyCode == Keys.F12)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;// 设置边框为 None
this.WindowState = FormWindowState.Maximized;// 最大化
this.TopMost = true;// 置顶
this.KeyPreview = true;// 允许窗体先收到键盘事件
this.KeyUp += new KeyEventHandler(Lottery_KeyUp);// 允许窗体先收到键盘事件
this.Show();//显示 Form
}
}
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;// 设置边框为 None
this.WindowState = FormWindowState.Maximized;// 最大化
this.TopMost = true;// 置顶
this.KeyPreview = true;// 允许窗体先收到键盘事件
this.KeyUp += new KeyEventHandler(Lottery_KeyUp);// 允许窗体先收到键盘事件
this.Show();//显示 Form
}
private void Lottery_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)//"Esc"按键退出全屏
{
this.WindowState = FormWindowState.Normal;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
}
if (e.KeyCode == Keys.F12)
{
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;// 设置边框为 None
this.WindowState = FormWindowState.Maximized;// 最大化
this.TopMost = true;// 置顶
this.KeyPreview = true;// 允许窗体先收到键盘事件
this.KeyUp += new KeyEventHandler(Lottery_KeyUp);// 允许窗体先收到键盘事件
this.Show();//显示 Form
}
}
0 0
- 【C#】C#winform 双击/按"F12"键全屏,按"Esc"键退出
- 按Esc键退出对话框
- winform 添加 esc 键退出窗体
- 防按Enter键、Esc键退出
- 按esc键退出的一个函数
- 按esc键退出的一个函数
- 如何按下ESC键退出程序
- ESC键退出
- C++判断字符与数字,按下esc键退出esc
- MFC工程添加按ESC键退出功能
- MFC对话框程序按Esc键不自动退出
- VC++ 屏蔽按ENTER或者ESC键退出程序
- flex esc退出全屏监听
- 双击退出全屏
- VB:按“ESC”退出窗体
- 捕获ESC键,退出程序
- Flash builder程序运行时全屏模式运行,而且用户按ESC键时,也不退出全屏模式。
- C# winform退出方法
- IntelliJ IDEA 如何识别多个maven.project
- Android Sqlite 链表查询语句
- iOS简单实现查看更多/收起的效果[最新]
- cURL实现Get和Post
- python多线程编程(5): 条件变量同步
- 【C#】C#winform 双击/按"F12"键全屏,按"Esc"键退出
- MVC, WEB MVC, SPRING MVC 图解
- 自我学习,监督学习,半监督学习和迁移学习的区别
- [LeetCode]142. Linked List Cycle II
- 基本的几个设计模式
- linux下配置maven运行环境
- spring mvc框架概述
- Maven的安装配置
- ngnix做Https访问设置及依据URL后缀分流访问