<StackPanel Margin="2">
<Button Name="btn" Click="btn_Click" Content="Load Profile Image">
<Button.Background>
<ImageBrush ImageSource="D:\Pictures\rectangles.jpg"></ImageBrush>
</Button.Background>
</Button>
</StackPanel>
我在这里粘贴的图像几乎是黑色的,所以我想将内容颜色更改为白色,以便它应该正确显示。
我的道歉,我没有在标题中添加颜色,用逗号引用,抱歉我的错误。现在可以了,我想现在读者很清楚了 ;)
最佳答案
假设您正在谈论要显示的文本的颜色,您需要 Foreground
属性(property)。
<Button Name="btn" Click="btn_Click" Content="Load Profile Image" Foreground="White">
关于wpf - 如何更改 wpf 中按钮的内容 "color",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28555219/