I am working on a project and so far it works fine. I have 3 forms and there will be more then, but now to the problem:
When the program starts Form1 will be shown. On a button I call this to open a new form:
Form2 frm = new Form2();
frm.ShowDialog();
Well, this works fine. Form2 will be shown in front of Form1 and if I close it Form1 is again the main form.
In Form2, I want to do the same, now, but Form2 should be closed and Form3 should be in the front. Well, this is not very difficult, but when I call it like that...
Form3 frm = new Form3();
frm.ShowDialog();
this.Close();
... Form2 will not close, because of ShowDialog. What can I do? I want that Form3 is in the front, Form2 is closed and Form1 is still there, but I cannot click on it, as Form3 should be called with ShowDialog.
At the moment Form3 is shown over Form2, but I want that it is shown over Form1. What can I do to solve this?
Of course the forms have other names, it is just to make it easier to understand.
Here you can see two pictures for understanding it better:
This is how it looks: http://www.directupload.net/file/d/3508/xmy99iwq_png.htm
Form2 is visible, but I want it to be closed.
Like here:
http://www.directupload.net/file/d/3508/qjvy42wq_png.htm
But I want that Form3 is in the front and you cannot click on Form1, like I called Form3 with ShowDialog in Form1.
frm.ShowDialog();
– Jonesopolis