WPF后台设置颜色字体等
2024-08-31 12:01:43
Button TempButton = new Button();
TempButton.Tag = “按钮标记”;
TempButton.Height = 30;
TempButton.Width = 100;
TempButton.Width = 100;
TempButton.Style = this.FindResource("ButtonStyle_blue") as Style;
//颜色
TempButton.Background = new SolidColorBrush(Colors.Black);//背景色
TempButton.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0x6e, 0x6e, 0x6e));//前景色(字体颜色)
//字体
//颜色
TempButton.Background = new SolidColorBrush(Colors.Black);//背景色
TempButton.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0x6e, 0x6e, 0x6e));//前景色(字体颜色)
//字体
TempButton.FontFamily = new FontFamily("Microsoft YaHei");
TempButton.FontSize = 13;
TempButton.FontWeight = FontWeights.Normal;
TempButton.FontWeight = FontWeights.Normal;
//布局
TempButton.Margin = new Thickness(0);
TempButton.VerticalAlignment = VerticalAlignment.Center;
TempButton.HorizontalAlignment = HorizontalAlignment.Right;
TempButton.HorizontalAlignment = HorizontalAlignment.Right;
//URL
(TempButton.Background as ImageBrush).ImageSource = new BitmapImage(new Uri(“图片路径”), UriKind.Absolute));
Wrappanel.Children.Add(TempButton);
最新文章
- 【Win10 应用开发】自定义应用标题栏
- BZOJ 2882: 工艺
- Bootstrap学习笔记系列3-------Bootstrap简单表单显示
- javascript 之Object内置对象
- paper 107:图像的白平衡
- BCB中获得RichEdit 默认行间距
- iOS 延迟执行
- VR应用里面的Photogrammetry技术是什么
- 《C和指针》章节后编程练习解答参考——第9章
- Map(关联式容器)
- CODE[VS]-保留两位小数-浮点数处理-天梯青铜
- C#读取Excel的其中一种方式OleDb读取(100万条)--快速大量插入SQL中
- loading.io一个可以直接生成loading gif图标的站点
- Elixir游戏服设计一
- python项目推荐(转载知乎)
- 【接口时序】5、QSPI Flash的原理与QSPI时序的Verilog实现
- Linux下Clamav 杀毒软件安装使用文档
- python 遍历list并删除部分元素
- java及spark2.X连接mongodb3.X单机或集群的方法(带认证及不带认证)
- px em rem 区别