namespace WindowsApplication3 { partial class Form1 : Form { private bool expanded; public Form1() { InitializeComponent(); expanded = false; } private void button1_Click(object sender, EventArgs e) { if (expanded) { this.Height = this.Height - groupBox1.Height; expanded = false; button1.Text = "Expand >>"; } else { this.Height = this.Height + groupBox1.Height; expanded = true; button1.Text = "<< Collapse"; } } } }Regards