空间类都继承自 System.Windows.Control
支持设置控件内容对齐方式
tab顺序
绘制背景,前景和边框
格式化文本内容的尺寸和字体
前景画刷,背景画刷
cmd.Background = new SollidColorBrush(Colors.AliceBlue);
系统画刷颜色SystemColors.ControlColor
cmd.Foregroud = new SolidColorBrush(Color.FromRgb(red,green,blue));
透明颜色画刷Color.FromArgb(); Alpha
XAML : <Button Background = "Red">A Button</Button>
字体:
<Button name=”cmd" FontFamily="Times New Roman" FontSize="18">A Button</Button>
或
cmd.FontFamily = "Times New Roman";
cmd.FontSize = "18";
字体嵌入
1、添加字体文件.ttf Build Action设置为Resource
2. <Label FontFamily="./#Bayern" FontSize="20">This is an embedded font</Label>
鼠标光标