在Windows窗体中:
private void button1_Click(object sender,EventArgs e) { this.WindowState = FormWindowState.Minimized; }
在WPF中:
private void button1_Click(object sender,RoutedEventArgs e) { this.WindowState = WindowState.Minimized; }