To prevent the window from being shown, paste this code into your form:
protected override void SetVisibleCore(bool value) {
if (!this.IsHandleCreated) {
CreateHandle();
value = false;
}
base.SetVisibleCore(value);
}
Beware that the Load event won't run until you explicitly make your form visible so move any code you've got there inside the if statement.
Not getting the DocumentCompleted event to run is usually caused by not running a message loop (Application.Run). WebBrowser requires one, and a thread that's marked with [STAThread], in order to fire its events. The message loop is very important for COM components.
Is it also important to prevent the invisible form from stealing focus, with the code below:
protected override bool ShowWithoutActivation
{
get { return true; } // prevents form creation from stealing focus
}
and
form1.Enabled = false; // prevents inner controls from stealing focus