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

我怕爱的太早我们不能终老 提交于 2019-12-08 06:13:50

问题


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.


回答1:


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>


来源:https://stackoverflow.com/questions/2708393/how-to-set-the-rounded-inside-corners-of-a-grid-in-silverlight-4

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