I have these codes in my program. But the this.close doesn't function. And because the previous form didn't close, it overlaps with the second one. What should I do to be able to open just one form at a time? I have set a value to get the content of lblScore
located in form1 to be displayed on form2. But, I wish to close the form1 so that the only form that is open will be the form2. How can I do that?
if (score >= 2) {
timerDrop.Enabled = false;
MessageBox.Show("Time's Up! You can now proceed to the next Level!");
frmLevel2 lvl2 = new frmLevel2();
lvl2.Show();
lvl2.set = lblScore.Text;
this.Close();
} else {
timerDrop.Enabled = false;
MessageBox.Show("Time's Up! GAME OVER!");
frmMenu frmBackToMenu = new frmMenu();
frmBackToMenu.Show();
this.Close();
}
Thanks.