I am trying to display some html in a WebBrowser control in a windows form and would like to resize the form based on the html contents.
I can do this by looking at webBrowser1.Document.Body.ScrollRectangle.Size
in the DocumentCompleted
event. However that event is not triggered until the form is displayed. Hence I need to display the form and then re-size it.
Is there any way to avoid this flashing and get the form initialised to the correct size?