Since this post seems popular but nobody has answered it, I had better post what I have learned:
Everything is based on SharpDevelop 4.4 with NET 4.5 installed on Win 7 Pro with latest Microsoft SDK.
Select Default Layout or Debug Layout from the pulldown menu at top of page.
1. Click on the tab in the main working area that shows the code you are currently working on -- by default Form1.cs
2. At the foot of the main working area, select the Design Tab
4. Your design appears in the main working area. Click on the browser element shown in the design.
5. In the right hand panel, the properties of the web browser appear. In the section Behavior, select "url"
6. To the right of "url" enter "about
:blank"
7. Set the next item in the list "visible" to false.
8. Go to the section of your code that describes the design of your application. This may be in a separate file called, for example, Form1.Designer.cs
Here, manually insert the following line at the end of the browser element section (by default it's called webBrowser1):
this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEv entHandler(this.WebBrowser1DocumentCompleted);
This sends a DocumentCompleted signal to your main code. (see point 11)
9. Return to your main code file -- by default Form1.cs
10. Click on the Source tab below left.
11. Add this or similar code to pick up the DocumentCompletedsignal:
-
private void WebBrowser1DocumentCompleted(object sender, EventArgs e)
-
{
-
/// <summary>
-
/// On page completion. this happens:
-
/// </summary>
-
string z= webBrowser1.Url.ToString();
-
if(z == "about:blank"){
-
webBrowser1.Document.Write ("<!DOCTYPE html><html><head><meta charset='utf-8'><meta http-equiv='content-type' content='text/html; charset=utf-8'>"+
-
"<title>Please wait</title></head><body style='background-color:Silver'><div style='text-align:center;padding-right:100px;'>"+
-
"<DIV ID=MYDIV style='position:absolute;left:200px;top:60px;width:180px;height:60px;border:1px solid lightslategrey;padding:10px;"+
-
"font-family:arial unicode ms;arial;font-size:13px;background-color:#efefef;color:#000;text-align:center;'>"+
-
"Please wait<br>Your page is loading"+
-
"</DIV></body></html>");
-
-
webBrowser1.Visible = true;
-
webBrowser1.Navigate("http://duckduckgo.com");
-
}
-
}
-
12. You can see, I have set here the background color of the body element to Silver.
This color must be the same as the background color of the main form -- the base element of your application.
To make this Silver (or whatever color you prefer) go here:
13. Select the Design tab of Form1.cs
14. In the properties panel to the right, click on the small black down arrow, top right.
15. Choose the main form section from the drop-down menu -- by default called simply "Form1"
16. Select BackColor and change it to "Silver"
17. Scroll down to the foot of this section with the scrollbar on the right. Do not use the mouse wheel: this would change the element you are working on.
18. Last item is Transparency Key. Click the arrow to the right, choose the "Web" tab and then "Silver".
19. Save and run Debug.
Hope it works for you.