Click here to Skip to main content
15,915,328 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Remote exe - Rephrase question Pin
Colin Angus Mackay6-May-05 11:56
Colin Angus Mackay6-May-05 11:56 
GeneralRe: Remote exe - Rephrase question Pin
Dave Kreskowiak6-May-05 12:30
mveDave Kreskowiak6-May-05 12:30 
GeneralReporting Woes... Pin
Robert M Greene6-May-05 9:27
Robert M Greene6-May-05 9:27 
GeneralRe: Reporting Woes... Pin
Tad McClellan8-May-05 14:26
professionalTad McClellan8-May-05 14:26 
Generalclosing form Pin
Anonymous6-May-05 0:26
Anonymous6-May-05 0:26 
GeneralRe: closing form Pin
MoustafaS6-May-05 2:14
MoustafaS6-May-05 2:14 
GeneralRe: closing form Pin
Anonymous6-May-05 6:08
Anonymous6-May-05 6:08 
GeneralRe: closing form Pin
Dave Kreskowiak6-May-05 7:30
mveDave Kreskowiak6-May-05 7:30 
Well, since Form holds the references to all the other forms, it can't close until all of its child forms close. Which, in your case, can't happen because your Form2 is stuck waiting for a mesagebox to close.

What you'll have to do is implement a status mechanism on Form2. In Form1's closing event, it has to check with all the forms it opened and ask each one if it is safe to close, and if so, then it can close itself after it closes each of the child forms.

Each of the forms that your Form1 opens has to implement some kind of method to track its own status. For instance, if Form2 opens a MessageBox, it has to update a flag in its code that says that it is "not OK to close". When the MessageBox finally returns, then it can change that flag to something that means "OK to close". When Form1 iterates through all the forms that it opened, it calls a function on each form that checks that flag. If any of the forms returns that it is NOT ok to close, then Form1 has to abort closing itself.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralHelp Me to port to Win98 Pin
Saksida Bojan5-May-05 23:30
Saksida Bojan5-May-05 23:30 
GeneralRe: Help Me to port to Win98 Pin
Dan_P5-May-05 23:43
Dan_P5-May-05 23:43 
GeneralRe: Help Me to port to Win98 Pin
Saksida Bojan6-May-05 1:34
Saksida Bojan6-May-05 1:34 
GeneralRe: Help Me to port to Win98 Pin
Dave Kreskowiak6-May-05 7:18
mveDave Kreskowiak6-May-05 7:18 
GeneralRe: Help Me to port to Win98 Pin
Saksida Bojan6-May-05 10:54
Saksida Bojan6-May-05 10:54 
GeneralRe: Help Me to port to Win98 Pin
Dave Kreskowiak6-May-05 12:24
mveDave Kreskowiak6-May-05 12:24 
GeneralThank For Help Pin
Saksida Bojan7-May-05 3:04
Saksida Bojan7-May-05 3:04 
GeneralPocket PC image processing problems Pin
redleafong5-May-05 18:35
redleafong5-May-05 18:35 
QuestionWhy is Textbox not working? Pin
Richard Jones5-May-05 9:30
Richard Jones5-May-05 9:30 
AnswerRe: Why is Textbox not working? Pin
Colin Angus Mackay5-May-05 10:42
Colin Angus Mackay5-May-05 10:42 
GeneralRe: Why is Textbox not working? Pin
Richard Jones6-May-05 2:20
Richard Jones6-May-05 2:20 
GeneralExtracting cab file : FDICopy() Failed: code 11[User aborted] Pin
Sheela Krishnan5-May-05 5:42
Sheela Krishnan5-May-05 5:42 
GeneralOverlapping Images with Windows Forms/PictureBox Pin
pcxboy4-May-05 18:27
pcxboy4-May-05 18:27 
GeneralRe: Overlapping Images with Windows Forms/PictureBox Pin
MoustafaS5-May-05 1:47
MoustafaS5-May-05 1:47 
GeneralRe: Overlapping Images with Windows Forms/PictureBox Pin
pcxboy5-May-05 2:59
pcxboy5-May-05 2:59 
QuestionHow to create database for smart device like Pocket PC Pin
Member 19358804-May-05 7:28
Member 19358804-May-05 7:28 
AnswerRe: How to create database for smart device like Pocket PC Pin
Dan_P4-May-05 14:57
Dan_P4-May-05 14:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.