D
dancardoso
Hi everybody,
I believe something weird is happening with my windows forms desktop
application. I have a main form (Form1, shown using Application.Run)
and this main form opens a modal form (Form2), using ShowDialog(this)
so that the owner of Form2 is Form1. Form2 does the same thing with
Form3 (ie, Form2 opens Form3 modally, using showDialog(this.Owner), so
that the owner of Form3 is Form1 too. Form3, once more, opens Form4
passing a reference to Form1 in the owner parameter of showDialog.
The weird thing happens now: Form4 has a button that minimizes the
application when clicked by setting Form1.WindowsState to Minimized.
When Form1 is minimized, all its 3 owned forms are minimized too. 'til
this point, everything's fine, but when Form1 is restored, only Form1
itself appear and I can freelly use it. The other modal windows do not
come back with Form1. Indeed, after some debugging I realized they were
being closed just after form1's minimization. Is this really the
expected behaviour?
What I need to do is to minimize the application and when the user
restores it, all 4 forms are shown as before minimizing. Is there any
way I can accomplish this? The reason for that is that in the real
application, the last form has a functionality to start another process
and I want the hole app to minimize so that the user can work with the
just-started application. After finishing work, the user should be able
to go back and restore the first application to continue working.
Thanks and sorry for the long post.
Daniel.
I believe something weird is happening with my windows forms desktop
application. I have a main form (Form1, shown using Application.Run)
and this main form opens a modal form (Form2), using ShowDialog(this)
so that the owner of Form2 is Form1. Form2 does the same thing with
Form3 (ie, Form2 opens Form3 modally, using showDialog(this.Owner), so
that the owner of Form3 is Form1 too. Form3, once more, opens Form4
passing a reference to Form1 in the owner parameter of showDialog.
The weird thing happens now: Form4 has a button that minimizes the
application when clicked by setting Form1.WindowsState to Minimized.
When Form1 is minimized, all its 3 owned forms are minimized too. 'til
this point, everything's fine, but when Form1 is restored, only Form1
itself appear and I can freelly use it. The other modal windows do not
come back with Form1. Indeed, after some debugging I realized they were
being closed just after form1's minimization. Is this really the
expected behaviour?
What I need to do is to minimize the application and when the user
restores it, all 4 forms are shown as before minimizing. Is there any
way I can accomplish this? The reason for that is that in the real
application, the last form has a functionality to start another process
and I want the hole app to minimize so that the user can work with the
just-started application. After finishing work, the user should be able
to go back and restore the first application to continue working.
Thanks and sorry for the long post.
Daniel.