在这段代码中,我在按钮文本之前添加了一个图像,我希望在图像和文本之间有一个空格,但是我的代码不起作用。
<Button Height="25"
Width="80"
Margin="5,10,5,10"
Command="{Binding PreviewTemplateCommand}">
<StackPanel Orientation="Horizontal" Height="15" Width="63">
<Image Source="/UILibrary;component/Themes/Default/Images/preview.PNG"
Height="15" Width="15" Margin="0,0,0,0" />
<TextBlock >Preview</TextBlock>
</StackPanel>
</Button>发布于 2015-05-26 20:13:45
嗨,你必须设置文本框的左边框。试试这个:
<StackPanel Orientation="Horizontal" Height="15" Width="63">
<Image Source="..." Height="15" Width="15" Margin="0,0,0,0" />
<TextBlock Margin="25,0,0,0">Preview</TextBlock>
</StackPanel>https://stackoverflow.com/questions/30467938
复制相似问题