This is a frustrating one. I've spent the last 3 days trying to figure out why a WebBrowser control hosted in a Windows Forms Host control was not displaying. What was odd is that it was "browsing" correctly, and if I moved the mouse over the area that should've displayed the webpage I was getting the "hand arrow" for links and "tooltips," but I was unable to actually see the content. I could even click on links and the browser would navigate, and I could also copy and paste the contents of the browser control into word if I wanted to see them.
There were a lot of variables that I had to examine which is why it took me part of the last 3 days to narrow things down. I was using code that I had to convert from C# and had customized for some display. Items other than those hosted in the WindowsFormsHost would work fine in my customized tab container control, but any item that was hosted in a windows forms host (I tried a textbox as well as the browser that I wanted to use) would not render visually.
After definitively ruling the conversion or customization out as the culprit I started looking at the properties of my window. My window had rounded edges and a WindowStyle of none. Its background was set to black but it had "AllowsTransparency" set so the background didn't show up at all giving me the rounded edge. After further tinkering I figured out that this was the culprit. If I set AllowsTransparency=False on the Window the hosted browser would start to display content. Of course my app didn't look very cool because I had black around my nicely rounded borders. This was easily fixed by changing the background from #00FFFFFF to #FFFFFFFF giving it a full alpha to acheive transparency. Doing this gave me the rounded look I wanted but still allowed the browser that was hosted in the WindowsFormsHost to display its content.
I hope this helps anyone else who is battling with this issue. We are desparately trying to do RAD in this environment but these sort of issues are really slowing us down...I guess thats the price you pay for using cutting edge dev tools. Sometimes is frustrating nonetheless!
Sean