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 by Serge

Serge
Wed Feb 13 14:07:33 CST 2008

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


"tshad" <tshad@dslextreme.com> wrote in message
news:uTx1zXnbIHA.4752@TK2MSFTNGP02.phx.gbl...
> 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 by Herfried

Herfried
Wed Feb 13 16:24:23 CST 2008

"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).

--
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 by Ravi

Ravi
Sun Feb 17 11:32:20 CST 2008

Contrary to the other replies, yes you can.

myTextBox.ForeColor = ...

Bolding is an other issue. :(

Hope this helps,

/ravi

-----------
"tshad" <tshad@dslextreme.com> wrote in message
news:uTx1zXnbIHA.4752@TK2MSFTNGP02.phx.gbl...
> 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 by Herfried

Herfried
Sun Feb 17 12:22:52 CST 2008

"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.

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