背景色は Background、フォント色は Foreground で指定します。
フォント色と背景色の変更方法
<Label Content="背景色が赤、文字色が白のラベル"
Background="Red"
Foreground="White"
Width="200">
</Label>
- 2行目: 背景色を赤にしています。
- 3行目: フォント色を白にしています。
検証環境
- .NET 5.0
- Microsoft Visual Studio Professional 2019 Version 16.9.4
- Microsoft Windows 10 Pro Version 20H2 OS Build 19042.928 Experience: Windows Feature Experience Pack 120.2212.551.0