views:

254

answers:

3

If I want to upload a text file into the textbox and want to highlight certain words with a font color change, how can I do that without drawing the text?

Thank you.

+1  A: 

RichTextBox control

volody
+1  A: 

Assuming WinForms, the ForeColor property:

TextBox.ForeColor = Color.Red;

As for what you wish to accomplish, the RichTextBox control will do it.

Will Marcouiller
A: 

RichTextBox will allow you to use html to specify the color. Another alternative is using a listbox and using the DrawItem event to draw how you would like. AFAIK, textbox itself can't be used in the way you're hoping.

Brandi