473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ShowDialog, Show and Disposed

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
Nov 15 '05 #1
0 1578

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3853
by: MrNobody | last post by:
I am using the no-arg ShowDialog() method hoping that the window would not be modal to any other window like the other ShowDialog(IWin32Window) method does, but when this opens it somehow becomes...
1
1153
by: e | last post by:
It would be a long and bizzare post to explain how I found it, but, in a nutshell... I have a main app. I have 2 "wizard" forms which I always .ShowDialog so they're modal. Sometimes, Wizard...
5
1578
by: Josh Golden | last post by:
3 forms. form 1, when button clicked instantiates form 2 which opens but is not shown. form 2 instantiates form 3 as showdialog. form 3 finishes, raises an event that form 2 catches. during the...
4
4377
by: Dennis Sjogren | last post by:
Greetings! First, I'm not 100% sure where to post this question. I use VB.NET for this project, but it's really a design question (a question on which method to use when solving this problem). ...
4
5830
by: Jm | last post by:
Hi all Im not sure of the best way to be displaying my forms and just want a bit of clarification. Being only recently moved to vb.net im still used to the old vb6 form.show method, now under...
4
12364
by: randy1200 | last post by:
I have a SideForm. If the use presses a button on the main form, the side form comes up by executing the following: SideForm sf = new SideForm() sf.ShowDialog(); This works perfectly. I've...
11
4178
by: osmarjunior | last post by:
I have a sequence of commands like this: Form1 frm = new Form1(); frm.LoadData(); Boolean confirm = (frm.ShowDialog() == DialogResult.OK); The LoadData method loads information from...
2
2107
by: NickP | last post by:
Hi there, I was wondering if there was any way to stop the hiding of a dialog from returning from the ShowDialog function? i.e. If you create your own dialog and put some code in that hides it...
8
11573
by: Joe Duchtel | last post by:
Hello - I have the following code to detemine a file name when my application is saving a file. The problem is that if the file already exists and I select the Yes button in the "Do you want to...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7064
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.