[英]How to Draw a circle button and make label over it
I want to make a circle button and label over it but I cant , I tried to make ellipse but I don't know how to make a label over it. 我想制作一个圆形按钮并在上面贴上标签,但我不能,我试图制作椭圆,但我不知道如何制作一个标签。 I want to make something exactly like this image 我想制作出与此图像完全相同的东西 Windows 8 Apps C# Windows 8应用程序C#
Use a Grid, place the Ellipse followed by the TextBlock in the Grid. 使用网格,在网格中放置椭圆,然后放置TextBlock。
<Grid>
<Ellipse ... />
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>
You can have a try on following method: 您可以尝试以下方法:
<Grid>
<Ellipse StrokeThickness="2" Stroke="Black" Width="150">
<Ellipse.Fill>
<ImageBrush ImageSource="/Image/someImage.png"/>
</Ellipse.Fill>
</Ellipse>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="The Demo Case" Margin="0,60,0,0" Foreground="Green"/>
</Grid>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.