Altering ForeColor in TextBox

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

I am trying to alter the ForeColor of a TextBox object so
that parts of the displayed text are written in various
colors. For example, when writing to the TextBox I wish
to display parts of the text in red and then other parts
of the text in black. Is it possible to do this with the
TextBox object or do I need to use the RichTextBox
object? Thank you for your help!

Scott
 
I beleive you can't do this with the ordinary textbox unless you are going
to implement your own drawing.

thanks,
Mohamed
--------------------
 
What do you mean by implementing your own drawing? Is
this very difficult to do or would you suggest using the
RichTextBox? Which method is typically used by other
developers?

Thanks,
Scott
 
Yes, I'd use RichTextBox as it will do the job for you. what I meant by
implementing your own drawing is to subclass the normal control and write
the text yourself which may be a bit difficult...

thanks,
Mohamed

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top