At the moment I am trying to use a dialog box to put progress messages on the screen as a long process takes place beneath. The box has a close icon (that X at the top right of the title bar) If the user clicks on the close icon this then closes the exe, but I would like to be able to keep the exe going and do some recovery routine to re-establish a known condition on the running exe.
Any ideas would be very welcome.
Thanks

Closing Dialog Box without ending exe
Mok4402
Alexander Safronov
JDiego
AYK
Hi Matthew
Having successfully closed the dialog box, I need to be able to set a global variable when the close occurs, to warn the app that this has happened. Do you know how I can best capture the point that this close click happens (I assume that there is an event that I can subscribe to) so that I can set this variable please.
Thanks
Julian Keith Loren MCSD MCAD
Chris Richner
ahives
{
Logging.WriteToLog(2, 2, "INFORMATION: Progress Closed"); Globals.ProgressTerminated = true;}
Into the Progress form class, but the application then terminated as soon as the progress form was opened, without tripping the debug set on the event! I'm off to bed to consider my options more tomorrow!
Jose Valim
Christian38
trnilse
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault( false );
Application.Run( new Form1() );
}
Simply add the extra code after the line "Application.Run( new Form1() );"
cc96ai
Icehellgx
Hi Matthew
I added the two lines above the .Run line, and it now semi-works!! Depending on what the underlying program was doing when the dialog box x was clicked. I will have to do a bit more checking, but I though I would let you know the initial results in the meantime.
Could you explain a bit more about adding the extra code after the .Run line please What code are you referring to
jchan