首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Infragistics ForeColor

Infragistics ForeColor
EN

Stack Overflow用户
提问于 2013-02-05 15:30:12
回答 2查看 1.4K关注 0票数 0

使用可用的R、G和B值,如何设置UltraLabelForeColor属性?我尝试过以下几种方法:

代码语言:javascript
复制
UltraLabel lbl = new UltraLabel();
lbl.Text = "Some text";
lbl.Appearance.ForeColor.R = 255; // ERROR: Property or indexer 'System.Drawing.Color.R' cannot be assigned to -- it is read only
lbl.Appearance.ForeColor.G = 255; // ERROR: Property or indexer 'System.Drawing.Color.G' cannot be assigned to -- it is read only
lbl.Appearance.ForeColor.B = 255; // ERROR: Property or indexer 'System.Drawing.Color.B' cannot be assigned to -- it is read only

还有没有其他的方法呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-02-05 15:38:18

也许可以试试:

代码语言:javascript
复制
lbl.Appearance.ForeColor = Color.FromArgb(r, g, b);
票数 4
EN

Stack Overflow用户

发布于 2013-02-05 15:36:49

代码语言:javascript
复制
lbl.Appearance.ForeColor = new Color(255, 255, 255);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14702246

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档