WPF xaml.cs 设置属性

//设置背景色
WL8.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#0A50A8"));
//设置字体颜色
WL8.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFF"));
//设置控件水平对齐
WL8.HorizontalContentAlignment= new System.Windows.HorizontalAlignment.Right;
//设置控件内边距
WL8.Padding= new Thickness(6, 4, 6, 0);

你可能感兴趣的:(wpf)