Different color text in textbox

T

tshad

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
 
H

Herfried K. Wagner [MVP]

tshad said:
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).
 
R

Ravi Bhavnani

Contrary to the other replies, yes you can.

myTextBox.ForeColor = ...

Bolding is an other issue. :(

Hope this helps,

/ravi
 
H

Herfried K. Wagner [MVP]

Ravi Bhavnani said:
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.
 

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

Top