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?)
Loading


Guest UserRank #816 · 2.8K reputationPosted Jul 14, 2015, 11:56 PM EDT
Guest UserRank #816 · 2.8K reputationPosted Jul 14, 2015, 11:43 PM EDT
status.ForeColor = System.Drawing.Color.Red;
Merajuddin Ansari57 reputationPosted Jul 14, 2015, 11:53 PM EDT
status.ForeColor = System.Drawing.Color.Red;
Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 15, 2015, 12:00 AM EDT