How can I close a form, which has my start point in it, without the application closing?
Printable View
How can I close a form, which has my start point in it, without the application closing?
I believe you can't (haven't checked this yet).
just converted the inspired by dynamic_sysop code.
frmMain
frmIDontKnowPHP Code:static void Main()
{
frmMain f=new frmMain();
f.Show();
Application.Run();
}
private void button1_Click(object sender, System.EventArgs e)
{
frmIDontKnow f=new frmIDontKnow(this);
f.Show();
}
private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Application.Exit();
}
hope this helps. if not, sorry. :(PHP Code:Form f;
public frmIDontKnow(Form f)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.f=f;
//
// TODO: Add any constructor code after InitializeComponent call
//
}
private void button1_Click(object sender, System.EventArgs e)
{
f.Close();
}
private void frmIDontKnow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
Application.Exit();
}