有没有办法以编程方式最小化窗口(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; }更多推荐
发布评论