textBox1.Background = Brushes.Blue;textBox1.Foreground = Brushes.Yellow;
WPF前景和背景类型
System.Windows.Media.Brush。您可以像这样设置其他颜色:
using System.Windows.Media;textBox1.Background = Brushes.White;textBox1.Background = new SolidColorBrush(Colors.White);textBox1.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0, 0));textBox1.Background = System.Windows.SystemColors.MenuHighlightBrush;
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)