0
我想在按钮模板内使用一个堆栈面板,但它不工作的图像下的文本。只有图像可见,文字不可见。使用模板,我可以将图像作为填充所有按钮的背景。见下:WPF:按钮模板中的图像下的文本
<Button Name="btnAdd" Height="36" Width="36" Click="btnAdd_Click" HorizontalAlignment="Center" Margin="10">
<Button.Template>
<ControlTemplate>
<StackPanel Orientation="Vertical">
<Image Source="/MyPath/Add.png"/>
<Label Padding="0">My Button Text</Label>
</StackPanel>
</ControlTemplate>
</Button.Template>
</Button>
我该怎么做才能使我的标签出现在图像和小字体下居中?
谢谢!有用。我是wpf的新手;) – user1624552
我们都开始了一次,不客气:) –