我试图让我的编辑框有黑色背景,所以我的构造函数如下所示:
GUI = new RichEditBox()
{
Margin = new Thickness(0, 510, 0, 0),
Width = 550,
Height = 250,
Background = new SolidColorBrush(Colors.White),
IsSpellCheckEnabled = false,
IsColorFontEnabled = true,
IsEnabled = false,
IsTextScaleFactorEnabled = false,
Opacity = 0,
SelectionFlyout = null,
FontFamily = new FontFamily("Consolas"),
FocusVisualPrimaryBrush = new SolidColorBrush(Colors.Black),
FocusVisualSecondaryBrush = new SolidColorBrush(Colors.Black),
Foreground = new SolidColorBrush(Colors.Black),
UseSystemFocusVisuals = false,
Header = "Bash"
};