Reputation: 2947
I close a form in C#
:
loginForm.Close();
However, after that I can open it anymore, the following doesn't work:
loginForm.ShowDialog();
Why is that?
Upvotes: 0
Views: 75
Reputation:
Most likely the underlying handles are disposed not to mention anything that ran in the constructor won't run again. Plus dialogs are a special beast and may have internal flags to indicate modal completion.
It's generally a bad idea to hang onto a window after it has been closed. Perhaps hiding and showing the window is more to your liking?
Upvotes: 2