C# 怎么退出全屏模式

mznxbc123456 mznxbc123456 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我在Load时写了这3行代码
this.TopMost = true;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState = FormWindowState.Maximized;

现在想通过按键盘上的ESC退出全屏,添加了
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 27)
{
this.WindowState = FormWindowState.Normal;
}
}

private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)27)
{
this.WindowState = FormWindowState.Normal;
}
}

调试的时候竟然都没有进我断点程序,请问这是怎么回事啊?
...全文
评论 4
收藏 已收藏
分享
返回顶部
mznxbc123456
C# 111,129 成员 642,540 内容