3

I'm sure it has been asked before (but couldn't find any resources that solves my problem), I'm creating a Silverlight application where users may install and use in OOB mode, using elevated trust. I want my "windowless window"s background to be transparent so I've set the app to run windowless in OOB mode, and put some margin around my Grid (main grid) along with a drop shadow effect. What I'm trying to achieve is the "zune window" effect: a rectangular main borderless window with drop shadow. I was able to do it in WPF but in Silverlight, I'm getting a white background:

enter image description here

I don't want this white background, and I've double checked that NOTHING has a white background set, but I'm still getting this. How can I get rid of that white border (obviously while keeping the drop shadow effect)?

Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
  • SL5 + P/Invoke + DWM = awesome – Denis Aug 12 '11 at 21:57
  • even if SL5 (final) was here now, wouldn't using P/Invoke lock my app to Windows only, killing the whole idea of desgning the app in SL instead of WPF.. – Can Poyrazoğlu Aug 12 '11 at 21:59
  • 1
    not exactly, your application running on vista and win 7 would get upgraded visuals while on XP and Mac it would use standard chrome. Much better than windows or bust you get with WPF. But if WPF is that you want then just go with it, WPF on windows and SL on Mac could be another way of doing it. – Denis Aug 12 '11 at 23:10
  • if i could use P/Invoke selectively then it's ok, i thought it was platform-specific. I'll be waiting for SL5 then and until then I'll be using standard window i guess.. – Can Poyrazoğlu Aug 12 '11 at 23:22
  • @Denis Do you have more leads to a P/Invoke solution? I know Silverlight inside out, but I'm weak on Win32. – John Feb 08 '13 at 13:36
  • @Denis I found this (http://trelford.com/blog/post/AgSpackle.aspx), but still I managed only to make the whole window transparent, not to control where. In other words, how to get rid of the underlying background of the silverlight launcher? – John Feb 08 '13 at 13:53
  • Unfortunately, I don't have "ready made" solution and I moved on from silverlight. To get to desired solution you would need to know Win32 windowing APIs and DWM APIs. The blog post you found provides good starting point, but I afraid it is up to you finish it. Good luck. – Denis Feb 08 '13 at 19:34

1 Answers1

1

The short answer is: you can't.

The long answer is: The Window object represents a client window with a solid color background and there is no way to change that color.

AnthonyWJones
  • 187,081
  • 35
  • 232
  • 306