I've got a Windows Forms application. There is a form that may be shown by
clicking a command button on either of 2 other forms. I use ShowDialog in
all cases to get modal behavior. When the app starts up, I show a main form
that is maximized and serves as the background for all three other forms.
In the first case, everything works as expected when clicking the command
button. The initial form closes, the second form is shown and when I close
the 2nd form, the initial is shown again.
In the second case, when the initial form closes, the entire background of
the app disappears. The second form shows but the background is my VS IDE.
When I close the second form, the initial shows again and reverts to my main
app background.
I want explicit control over when each form is shown so I load the forms
into a stack. The command buttons actually call a method that displays the
top form on the stack using ShowDialog and when a form is closed it is popped
off the stack.
Any thoughts on why this could be occurring?