Is there a way to programmatically minimize a window

C#.Netvb.netWinforms

C# Problem Overview


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.

C# Solutions


Solution 1 - C#

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

Solution 2 - C#

FormName.WindowState = FormWindowState.Minimized;

Solution 3 - C#

in c#.net

this.WindowState = FormWindowState.Minimized

Solution 4 - C#

<form>.WindowState = FormWindowState.Minimized;

Solution 5 - C#

Form myForm;
myForm.WindowState = FormWindowState.Minimized;

Solution 6 - C#

There's no point minimizing an already minimized form. So here we go:

if (form_Name.WindowState != FormWindowState.Minimized) form_Name.WindowState = FormWindowState.Minimized;

Solution 7 - C#

-- c#.net

NORMALIZE this.WindowState = FormWindowState.Normal;

this.WindowState = FormWindowState.Minimized;

Solution 8 - C#

this.WindowState = FormWindowState.Minimized;

Solution 9 - C#

this.MdiParent.WindowState = FormWindowState.Minimized;

Solution 10 - C#

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.Hide()

End Sub

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionStephen WrightonView Question on Stackoverflow
Solution 1 - C#John DagesView Answer on Stackoverflow
Solution 2 - C#JP RichardsonView Answer on Stackoverflow
Solution 3 - C#chetanView Answer on Stackoverflow
Solution 4 - C#Craig EddyView Answer on Stackoverflow
Solution 5 - C#Stephen DekenView Answer on Stackoverflow
Solution 6 - C#profnotimeView Answer on Stackoverflow
Solution 7 - C#Thailor SouzaView Answer on Stackoverflow
Solution 8 - C#Abdul MoizView Answer on Stackoverflow
Solution 9 - C#Tech InitiatorView Answer on Stackoverflow
Solution 10 - C#GoroundoVipaView Answer on Stackoverflow