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?
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: