Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何绘制圆形按钮并在其上制作标签_C#_.net_Windows_Windows Store Apps - Fatal编程技术网

C# 如何绘制圆形按钮并在其上制作标签

C# 如何绘制圆形按钮并在其上制作标签,c#,.net,windows,windows-store-apps,C#,.net,Windows,Windows Store Apps,我想做一个圆形按钮和标签,但我不能,我试图使椭圆,但我不知道如何使标签在它。 我想做一些和这张照片一模一样的东西 Windows 8应用程序C#使用网格,将椭圆后跟文本块放置在网格中 <Grid> <Ellipse ... /> <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> 您可以尝试以下方法: <Grid>

我想做一个圆形按钮和标签,但我不能,我试图使椭圆,但我不知道如何使标签在它。 我想做一些和这张照片一模一样的东西
Windows 8应用程序C#

使用网格,将椭圆后跟文本块放置在网格中

<Grid>
   <Ellipse ...  />
   <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" />
</Grid>

您可以尝试以下方法:

<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>

阅读