有没有一种方法来编程最小化窗口
我正在做的是我有一个全屏幕的forms,没有标题栏,因此缺乏在右上angularfind最小化/最大化/closuresbutton。 我想用键盘快捷方式和上下文菜单项取代该function,但我似乎无法find触发事件来最小化窗体。
private void Form1_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar == 'm') this.WindowState = FormWindowState.Minimized; }
FormName.WindowState = FormWindowState.Minimized;
在c#.net
this.WindowState = FormWindowState.Minimized
<form>.WindowState = FormWindowState.Minimized;
Form myForm; myForm.WindowState = FormWindowState.Minimized;
将已经最小化的表格最小化是没有意义的。 所以在这里我们去:
if (form_Name.WindowState != FormWindowState.Minimized) form_Name.WindowState = FormWindowState.Minimized;
this.MdiParent.WindowState = FormWindowState.Minimized;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Hide() End Sub