Reputation: 5840
In my app i am showing stocks quotes.
I am using a string with few stocks and its quotes and show it in a kind of marquee control. Is it possible to print the String and show it on the control so that a few words will be in red(the descending stocks) and a few in green(the rising ones)?
Upvotes: 0
Views: 127
Reputation: 2154
Use rich text box and you can do something in richTextBox1_PreviewKeyDown event of rich text box
private void richTextBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (richTextBox1.SelectionColor != Color.Red)
{
richTextBox1.SelectionColor = Color.Red;
}
if (e.KeyCode == Keys.Enter)
{
richTextBox1.SelectionColor = Color.Blue;
}
}
Upvotes: 0
Reputation: 108937
You can do that very easily with a RichTextBox. This post has a simple example.
Upvotes: 2