Phani Kumar PV
Phani Kumar PV

Reputation: 892

how to set the rounded inside corners of a grid in Silverlight 4

I need to set the rounded corners inside the grid control using silverlight 4.

When I tried to do something like this:

<Border BorderThickness="2" BorderBrush="#FF3EA9F5" Grid.Row="1" CornerRadius="5,5,0,0" Height="10" VerticalAlignment="Bottom">
   <Grid  x:Name="Phani1" Width="auto"> </Grid>
</Border>

I am able to see rounded corners outside the grid. But I want to grid to appear as a rectangle from outside border. But the inside corners of the grid should appear as rounded.

Please let me know how to do that if anyone had any idea on that.

Upvotes: 1

Views: 4785

Answers (1)

Ian Oakes
Ian Oakes

Reputation: 10253

The grid will always have square corners but you can assign a Margin="1,1,1,0" to the grid to stop it from overlapping the corners of the border.

<Border BorderThickness="2" BorderBrush="#FF3EA9F5" Grid.Row="1"
    CornerRadius="5,5,0,0" Height="10" VerticalAlignment="Bottom"> 
    <Grid x:Name="Phani1" Margin="1,1,1,0" Width="auto"> </Grid> 
</Border>

Upvotes: 5

Related Questions