在Silverlight中从颜色类型转换为字符串 [英] Conversion From Color Type To String in Silverlight

查看:86
本文介绍了在Silverlight中从颜色类型转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个组合框,其中列出了以下颜色;

Hi,
I have a combobox which I listed colors as below;

Type colorType = typeof(Colors);
PropertyInfo[] propInfoList =
    colorType.GetProperties(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public);
foreach (PropertyInfo c in propInfoList)
{
    this.cmbColors.Items.Add(c.Name);
}



那不是我的工作,但是我想简化我的工作,如下所示:

假设我的表格栏为:名称,姓氏,地址,颜色(varchar).
我应该从组合框中选取颜色,并将其作为字符串插入数据库的颜色列中.另外,我应该能够在来自其他冒号数据库的窗口中显示颜色.

如何在 Silverlight 中将颜色类型转换为字符串?我尝试了几件事,但是没有用.



That is not my work , but I want to simplify my work as below;

Let''s say my table columns: Name,Surname,Address ,Color(varchar).
I should take the color from combobox and insert into color column as string to database. Also I should be able to show the color in a window which comes from database with other colons.

How can I convert color type to string in Silverlight? I tried a few thing , but they did''t work.
Thanks for the replies, in advance..

推荐答案

ToString()一定可以工作吗?
ToString() will surely work ?


这篇关于在Silverlight中从颜色类型转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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