How to minimize a form in C#

1 Answer

0 votes
using System;

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            label1.Text = this.WindowState.ToString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;

            label1.Text = this.WindowState.ToString();
        }
    }
}



/*
 * run:
 * 
 * Normal
 * Minimized
 * 
 */

 



answered Jul 27, 2023 by avibootz

Related questions

1 answer 117 views
1 answer 95 views
1 answer 118 views
118 views asked Jul 27, 2023 by avibootz
1 answer 140 views
1 answer 122 views
...