bes7252

Can I round the corners of a usercontrol I want the background of its parent to show through where appropriate.

Here's the basic structure:

<UserControl x:Class="MPG.Controls.LeftArrow" ToolTip="Previous Customer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>

<Viewbox Stretch="UniformToFill" StretchDirection="Both" Margin="1,1,1,1">
<Grid Width="Auto" Height="Auto">
.....

</Grid>
</Viewbox>
</UserControl>




Re: Windows Presentation Foundation (WPF) Rounded Corners on UserControl

Josh Smith

Try setting the UserControl's Background to Transparent. Then put a Border as the UC's root visual, and configure the Border's Background, BorderBrush, BorderThickness, and CornerRadius to the values you like. That should provide the effect you're looking for.