Sandeep
Sandeep

Reputation: 5771

Infragistics UltraLabel ForeColor

With the available R, G & B values, how do I set the ForeColor property of an UltraLabel? I've tried the following:

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

Any other ways to do this?

Upvotes: 0

Views: 1651

Answers (2)

h.alex
h.alex

Reputation: 902

maybe try:

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

Upvotes: 4

Denis
Denis

Reputation: 6082

lbl.Appearance.ForeColor = new Color(255, 255, 255);

Upvotes: 0

Related Questions