我正在尝试在小 Button
中添加图标,但它没有按预期进入,
这里是我的 xaml:
<Button x:Name="eye_button" BorderBrush="{x:Null}" Margin="234,0,0,0" Height="15" Width="15">
<materialDesign:PackIcon Kind="Eye" Foreground="Black" />
</Button>
这是它的样子:
左边是按钮,右边是图标
最佳答案
试试这个:
<Button x:Name="eye_button" BorderBrush="{x:Null}" Margin="234,0,0,0" HorizontalAlignment="Left">
<materialDesign:PackIcon Kind="Eye" Foreground="Black" Width="15" Height="15" />
</Button>
运行时应该是这样的:
关于wpf - 小按钮wpf内的图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50904056/