Thanks. What happens is it just stops working and it brings up an unhandled error: object was in a zombie state now I've figured out that it doesn't crash until it reaches this line:
this.WindowState = FormWindowState.Minimized;
now I've got a check on resizing:
void MainFormResize(object sender, EventArgs e)
{
if(this.WindowState == FormWindowState.Minimized){
this.ShowInTaskbar = false;
notifyIcon1.Visible = true;
}else{
this.ShowInTaskbar = true;
notifyIcon1.Visible = false;
fetch\_iniData("data.ini", true);
}
}
For some reason it is the:
this.ShowInTaskbar = false;
That is causing it to crash... I can't see why though. The strange thing is that it's calling up the same function that is called on a button press, which works fine.. so why it works then and not when the application loads is beyond me:confused: