views:

314

answers:

1

I need to set the rounded corners inside the grid control using silverlight 4. wehn 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 gird. 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.

Thanks in advance.

+4  A: 

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>
Ian Oakes
can u explain with a piece of code as i am not well versed with XAML
Phani Kumar PV
@Phani: If you are going to be using Silverlight but need things explained "in code" you're in trouble. Xaml __is__ code, just a differrent type of code with a different purpose. Start here:- http://www.silverlight.net/learn/
AnthonyWJones