Hi
I'm working on a program that will have 3 forms: a main form, a status
form and a sub-form.
The main form and status form are always appear, and my sub-form is a
singleton (for performance issue).
As usual, I have two ways to display the sub-form: Show() and
ShowDialog().
When I use ShowDialog() (the main form calls it), the program works
fine but I cannot access the main form and the status form (also
called by the main form). Because I still want to have access to the
other forms, I have to use Show()
But my program will crash with Show() because unlike ShowDialog(),
when the form that opened with Show() is closed, the form is also
disposed. This is not what I wanted because it's a singleton and I
want it to be disposed when the main form closed (the whole program
terminates).
I think I should override an event to suspent the Disposing but I
can't find which event I should use, and how would I do it. Any help
is welcome.
Best Regards,
Homa Wong