0

使用可用的 R、G 和 B 值,我如何设置ForeColoran 的属性UltraLabel?我尝试了以下方法:

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

还有其他方法可以做到这一点吗?

4

2 回答 2

4

也许尝试:

lbl.Appearance.ForeColor = Color.FromArgb(r, g, b);
于 2013-02-05T07:38:17.703 回答
0
lbl.Appearance.ForeColor = new Color(255, 255, 255);
于 2013-02-05T07:36:49.243 回答