I'm trying to minimize the main form I created within Class1.
My main form is
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Class1 b1;
b1 = new Class1();
//minimizeWindow();
}
public void minimizeWindow()
{
this.WindowState = FormWindowState.Minimized;
}
}
my class
public class Class1
{
// Constructor
public Class1()
{
Form1 form = new Form1();
form.Show();
form.minimizeWindow();
}
}
I have tried to make a static method in my form but I couldn't use "this.form" its saying you coulnd't use this in a static function.