Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to redirect from one form to another, closing the previous form?

$
0
0

How to redirect from one form to another, closing the previous form?

I used :

private void btnGenBill_Click(object sender, EventArgs e)
        {
            PrintOut po = new PrintOut();
            po.ShowDialog();
        }

        private void btnInvent_Click(object sender, EventArgs e)
        {
            Form1 form = new Form1();
            form.Show();
        }


But ShowDialog() and Show() sets focus on the new form and DOES NOT close the previous form.
What shall I use to tackle this issue?


Viewing all articles
Browse latest Browse all 12583

Trending Articles