all groups > dotnet windows forms > february 2008 >
You're in the

dotnet windows forms

group:

Different color text in textbox


Different color text in textbox tshad
2/13/2008 11:21:52 AM
dotnet windows forms:
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

Re: Different color text in textbox Serge Wautier
2/13/2008 9:07:33 PM
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


[quoted text, click to view]
Re: Different color text in textbox Herfried K. Wagner [MVP]
2/13/2008 11:24:23 PM
"tshad" <tshad@dslextreme.com> schrieb:
[quoted text, click to view]

No, the Windows Forms textbox control doesn't support that (except in WPF).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Re: Different color text in textbox Ravi Bhavnani
2/17/2008 12:32:20 PM
Contrary to the other replies, yes you can.

myTextBox.ForeColor = ...

Bolding is an other issue. :(

Hope this helps,

/ravi

-----------
[quoted text, click to view]

Re: Different color text in textbox Herfried K. Wagner [MVP]
2/17/2008 7:22:52 PM
"Ravi Bhavnani" <ravib@ravib.com> schrieb:
[quoted text, click to view]

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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
AddThis Social Bookmark Button