I want to open the second form in my app which I managed to do, but the first form is still opened in the background. How can I close it?
private void BtnLogin_Click(object sender, EventArgs e)
{
var newForm = new Form2();
if (string.Equals(txtbName.Text, "Georgi") && string.Equals(txtbPassword.Text, "123"))
{
newForm.Show();
}
else
{
label2.Text = "Wrong password or username.Try again";
}
}