Search
Thursday, November 20, 2008 ..:: Blendblog.net ::.. Register  Login
 Bloggers Minimize

 Print   
 Sponsors Minimize

 Print   
 Users Online Minimize
Membership Membership:
Latest New User Latest: areel
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 15

People Online People Online:
Visitors Visitors: 0
Members Members: 0
Total Total: 0

Online Now Online Now:

 Print   
 Welcome to blendblog.net! Minimize

If you are a developer or designer who is creating cutting edge user interface experiences using Microsoft Expression Blend you've just found a great resource!  The purpose of this site is to share our experience with this brand new product.  As with any new piece of software there is a ton to discover.  Bugs will be revealed and workarounds discovered, hopefully this can be a resource to share in the discovery process!

While this site will focus largely on Expression Blend, it will also encompass WPF, Visual Studio, Silverlight, and other .net 3.5 technologies as they relate to the creation of great software.

Please login using your Microsoft LiveID or register a new account.  Doing so will let you comment on any of the blog entries on the site.  We look forward to helping you in your endeavors as well as you helping others in theirs!  We'd love to have more bloggers on our site...if you are interested please register and contact us!


 Print   
 AllowsTransparency = True + WindowFormsHost control = Where's my content? Minimize
Location: BlogsSean Cullinan    
Posted by: Sean Cullinan 12/19/2007 5:19 PM

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

Permalink |  Trackback

Comments (3)   Add Comment
Re: AllowsTransparency = True + WindowFormsHost control = Where's my content?    By Karl Shifflett on 12/19/2007 5:44 PM
Nice blog entry. Bummer with the #00ffffff<br><br>This same issue comes into play in many other areas of WPF.<br><br>Karl

Re: AllowsTransparency = True + WindowFormsHost control = Where's my content?    By michbex on 1/9/2008 8:44 AM
Very interssting. I indeed faced the same issue but I still have one Problem:<br>If I change the Window Background Color to #FFFFFFFF the background appears in white (since AllowsTrasparency=False). Any idea?<br><br>Thanks for the great entry<br><br>Michael

Re: AllowsTransparency = True + WindowFormsHost control = Where's my content?    By stiphy31 on 1/18/2008 4:50 PM
Michael,<br><br>I am now seeing this behavior too. I swear that at first I was getting the transparancy I needed. My window project actually became a usercontrol so its working in the context of being hosted in another window so I haven't been able to further tinker. If anyone out there can explain a way to get a transparant window with the windows host control please post!


Your name:
Title:
Comment:
Add Comment   Cancel 

  
 Search Minimize

 Print   
 Archive Minimize

 Print   
 Blendblog Survey Minimize
Our next client application will be written using:




Submit Survey  View Results

 Print   
Copyright 2008 by blendblog.net   Terms Of Use  Privacy Statement
DotNetNuke® is copyright 2002-2008 by DotNetNuke Corporation