我怎样才能改变的StackPanel的背景颜色在编程的Windows Phone应用程序? [英] How can i change the background color of a stackpanel programmatically in windows phone app?

查看:606
本文介绍了我怎样才能改变的StackPanel的背景颜色在编程的Windows Phone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想设置的背景属性的的StackPanel ,现在我用下面的代码设置它,

  statusPanel.Background =新的SolidColorBrush(Colors.Cyan); 



但我只想设置一个十六进制值。我该怎么办呢?


解决方案

  statusPanel.Background =新的SolidColorBrush(颜色。 FromArgb(0xFF的,为0xFF,0,0)); 

如果这个回答你的问题,请右键检查左侧。


I just want set the background property of StackPanel , currently i setting it by the following code,

statusPanel.Background = new SolidColorBrush(Colors.Cyan);

But i just want to set a hexadecimal value. How can i do it??

解决方案

statusPanel.Background =  new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0, 0));

If this answered your question, Please check right on left side.

这篇关于我怎样才能改变的StackPanel的背景颜色在编程的Windows Phone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆