有没有办法以编程方式最小化窗口(Is there a way to programmatically minimize a window)

编程入门 行业动态 更新时间:2024-10-24 06:34:22
有没有办法以编程方式最小化窗口(Is there a way to programmatically minimize a window)

我在做什么是我有一个全屏幕的形式,没有标题栏,因此缺少在右上角找到的最小化/最大化/关闭按钮。 我想用键盘快捷键和上下文菜单项替换该功能,但是我似乎找不到一个事件来触发以最小化表单。

What I'm doing is I have a full-screen form, with no title bar, and consequently lacks the minimize/maximize/close buttons found in the upper-right hand corner. I'm wanting to replace that functionality with a keyboard short-cut and a context menu item, but I can't seem to find an event to trigger to minimize the form.

最满意答案

private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar == 'm') this.WindowState = FormWindowState.Minimized; } private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar == 'm') this.WindowState = FormWindowState.Minimized; }

更多推荐

本文发布于:2023-08-05 08:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1428802.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:最小化   没有办法   窗口   方式   window

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!