gpt4 book ai didi

wpf - 图片和文字之间的边距

转载 作者:行者123 更新时间:2023-12-03 10:27:50 25 4
gpt4 key购买 nike

在这段代码中,我在按钮文本之前添加了一个图像,我希望在图像和文本之间留一个空格,但是我的代码无法正常工作。

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

最佳答案

嗨,您必须设置文本块的左边距。试试这个:

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

关于wpf - 图片和文字之间的边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30467938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com