N
N
nika_fox2020-05-07 15:06:11
C++ / C#
nika_fox, 2020-05-07 15:06:11

Why is the main process hanging after closing the main form?

This is how I open a new form on the main form:

private void panel1_Click(object sender, EventArgs e)
        {
            Employees_Table employees_Table = new Employees_Table();
            employees_Table.StartPosition = FormStartPosition.Manual;
            employees_Table.Location = Location;
            employees_Table.Show();
            this.Hide();
        }


This is how I close the new form and show the main one again:
private void Employees_Table_FormClosed(object sender, FormClosedEventArgs e)
        {
            Main main = new Main();
            main.StartPosition = FormStartPosition.Manual;
            main.Location = Location;
            main.Show();          
        }

After that, the main form appears, after closing which the process remains hanging

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2020-05-07
@SaNNy32

Do you have two main forms MainForm? You don't have to do that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question