Can you have different color text is a standard TextBox?
I know you can in a RichText box but what about the TextBox.
Same with bolding - can you bold one line of text in the text box and then
unbold the next line?
Thanks,
Tom
Serge Wautier - 13 Feb 2008 20:07 GMT
You're asking for rich text in a non richtext box !
The answer is no, richtext is available from richtext box only ;-)
HTH,
Serge.
http://www.apptranslator.com - Localization tool for your applications
> Can you have different color text is a standard TextBox?
>
[quoted text clipped - 6 lines]
>
> Tom
Herfried K. Wagner [MVP] - 13 Feb 2008 22:24 GMT
"tshad" <tshad@dslextreme.com> schrieb:
> Can you have different color text is a standard TextBox?
>
> I know you can in a RichText box but what about the TextBox.
>
> Same with bolding - can you bold one line of text in the text box and then
> unbold the next line?
No, the Windows Forms textbox control doesn't support that (except in WPF).

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Ravi Bhavnani - 17 Feb 2008 17:32 GMT
Contrary to the other replies, yes you can.
myTextBox.ForeColor = ...
Bolding is an other issue. :(
Hope this helps,
/ravi
-----------
> Can you have different color text is a standard TextBox?
>
[quoted text clipped - 6 lines]
>
> Tom
Herfried K. Wagner [MVP] - 17 Feb 2008 18:22 GMT
"Ravi Bhavnani" <ravib@ravib.com> schrieb:
> Contrary to the other replies, yes you can.
>
> myTextBox.ForeColor = ...
>
> Bolding is an other issue. :(
Re-read the OP's post. You cannot change the color of a certain line in the
textbox.
The font can be changed by assigning a new font to the control's 'Font'
property. Specify 'FontStyle.Bold' to use a bold font.

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>