Add DropShadow to a Custom made Window (Blend)

谁说胖子不能爱 提交于 2019-12-21 03:57:08

问题


I am creating a custom Window form using Blend. (by setting AllowTransparency to True)

I've finished the design and it works pretty well. Now I want to add Shadow effect to it. (DropShadowEffect)

I can't do that because the Window itself is hidden so the effect won't show. And it doesn't work on the main Grid. No luck with adding a border and give the shadow to it.


回答1:


Ok I found the answer. ( With some help from this page )

First of all, Set the window's AllowTransparency to True. Then change it's Background to No Brush

Lets say you have something like this: (Ignore the Rectangle and Borders)

Then change the Grid's Background to White color. Now click on your Window and Add about 15 pixels to its width and height.

And change the Shadow settings:

Now you can see the shadow :)

I think you got the idea how this is working. Remember you can still play around with the Window height/weight and the Shadow settings to get a better effect.



来源:https://stackoverflow.com/questions/16730797/add-dropshadow-to-a-custom-made-window-blend

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!