Okay, say when an html code closes your webbrowser. It will close the webbrowser and leave the form blank. That is where the OnQuit function comes in.

Code:
Private Sub webbrowser1_OnQuit()
Unload Me
End Sub
This code does not work though, it just minimizes the form and leaves the form blank with only the toolbar stuff, why?