在wpf中,如何在代码中修改Button的背景色为指定颜色?
可以用这种方式:
Button.Background = System.Windows.Media.Brushes.ForestGreen;
我希望是通过“#FF255687”这样的字符串为button定义背景色。哪位大虾帮忙解决一下?
[解决办法]
System.Drawing.Color.FromArgb(0xFF,0x25,0x56,0x87);
发布时间: 2012-09-04 14:19:30 作者: rapoo
在wpf中,如何在代码中修改Button的背景色为指定颜色?
可以用这种方式:
Button.Background = System.Windows.Media.Brushes.ForestGreen;
我希望是通过“#FF255687”这样的字符串为button定义背景色。哪位大虾帮忙解决一下?
[解决办法]
System.Drawing.Color.FromArgb(0xFF,0x25,0x56,0x87);