4
Answers

How to change text color in c#

Hi all,
I have a string like
string mess="Success";
I want to change color of "Success" to green and write it to a log file.
I am able to write the normal text (that is in black color) in a file. But I am not able to convert the text color.
Could some body please help with the peice of code.
Thanks
Murali krishna.
Answers (4)
0
Vulpes
NA 98.3k 1.5m 11y
Try this code:

private void Form1_KeyDown(object sender, KeyEventArgs e)
{
   pressed = true;
   label1.Text = "Key Pressed: " + e.KeyCode;
   timer1.Stop();
   timer1_Tick(timer1, EventArgs.Empty);
   timer1.Start();
}