Merajuddin Ansari

Merajuddin Ansari

  • NA
  • 90
  • 14.7k

How Do I Change Label Color Dynamically Using C#.

Jul 15 2015 3:15 AM
Hi,
I have created a Label dynamically the code is as below.

Label status = new Label();
status.Text.ForeColor = System.Drawing.Color.Red;

and error is coming as below:-

'string' does not contain a definition for 'ForeColor' and no extension method 'ForeColor' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

Answers (4)