Welcome to Windows Presentation Foundation (WPF)
Top Tasks :

WPF Team Bloggers

Clipping of child elements

On the forums I saw this interesting problem where there was a need to round the corners of a stackpanel inside a border with cornerradius set... The top is what you get and the bottom image is what you want. The simplest thing to do here is to set the padding on the border so that the stackpanel doesnt bleed around the corners. But when that doesnt meet your requirements you will need to set the clip property on the child in the OnRender function so that you get the correct clipping. The code for the above is attached .(thanks to Ifeanyi) Share this post Read More...
Published Monday, April 07, 2008 11:18 AM by Lester's WPF blog
Filed under: , , ,

Comments

No Comments
Anonymous comments are disabled

Copyright © 2006 Microsoft Corporation. All Rights Reserved. | Terms of Use | Privacy Statement | Contact Us