Resolved Help me with WPF Window Closing event PLZ!

menekevin

New member
Joined
Mar 13, 2009
Messages
3
Programming Experience
1-3
Hi all,
I'm building a WPF window with WebBrowser control. When it raise the navigated event I have to avoid the user to close window with the X button. I've tried to set a variable in the class named Is_Logging to TRUE at start of my code and reput that to FALSE at the end of code.

When raise Closing event, I've put "If Is_Logging = TRUE -> e.Cancel = TRUE" but, after some different tries, also with a msgbox, I can't understand because if I click onto X button while the navigated code is processing, closing event does not recognize Is_Logging as TRUE...

I've tried also to process the "navigated" code slowly, putting a while counter, but nothing... Is_Logging is declared as Private in the same class, but I've tried also to declare it as Public into a module.

Any ideas? :(
 
Last edited:
Sorry all, code seems to work perfectly but it seems the "bugs" depends from the speed of code execution, faster than my hand... Furthermore, if I want avoid the user close windows, I found that I need a control of Is_Logging from the "navigating" event. Finally, is not a great problem, because it seems that the user close window at graphic level, code will processed until end... microsoft it's a mistery...
 
Back
Top