I have to code a program for a library, I have to embed a Web Browser for a website but the Web Browser can’t be close. So I have cancel closing but when a user clicks on a button in JS for closing window (window.Close) the program crash. I add :
HtmlDocument htmlDocument = this.webBibliotheque.Document;
htmlDocument.Window.Unload += new HtmlElementEventHandler(Window_Unload);
when the Document is charged. This code works and gets to catch the evenment but I don’t know what I have to do in my function :
void Window_Unload(object sender, HtmlElementEventArgs e)
{
}
Can anyone help me please?