V
V
Vimake2014-01-04 16:49:49
C++ / C#
Vimake, 2014-01-04 16:49:49

How can I open the second form in C# without hanging up, so that the first one closes?

Prescribed

Form2 f = new Form2();
                    f.ShowDialog();

The second form opens, but it freezes. And the program just doesn't work.
Question: How can I open the second form without hanging up and at the same time close the first one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Exvel, 2014-01-04
@Vimake

f.Show();

L
Liliana6, 2014-08-05
@Liliana6

Thank you for the correct wording of the question)
I myself had to think and look on the Internet and this is what I found. Let me tell you right now, I did it.
private void Button1_Click(object sender, EventArgs e)
{
MainForm Main = new MainForm();
this.Hide();
MainShowDialog();
this.Close();
}
as you can see, I also brought with the button Button. so that everything goes well.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question