I have 2 forms (main
and login
). I open the login form with this piece of code:
toolStripProgressBar1.Value = 50;
toolStripStatusLabel_dynamic.Text = "Proberen toegang te verkrijgen...";
Login login = new Login();
login.ShowDialog();
do_login();
And I have a toolstrip menu at the top of the login form with an eventhandler
like this:
private void afsluitenToolStripMenuItem_Click(object sender, EventArgs e) {
Application.Exit();
}
But after both forms are closed, the program continues to work (it calls the function do_login
.) But the variables aren't set, and the form is gone, so do_login
won't work at all...
So how will I make the whole execution of the program stop when I click the toolstrip?