Infragistics UltraLabel ForeColor

本文关键字:ForeColor UltraLabel Infragistics | 更新日期: 2023-09-27 17:57:33

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

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

还有其他方法吗?

Infragistics UltraLabel ForeColor

也许可以尝试:

lbl.Appearance.ForeColor = Color.FromArgb(r, g, b);
lbl.Appearance.ForeColor = new Color(255, 255, 255);