Different color text in textbox

  • Thread starter Thread starter tshad
  • Start date Start date
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
 
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).
 
Contrary to the other replies, yes you can.

myTextBox.ForeColor = ...

Bolding is an other issue. :(

Hope this helps,

/ravi
 
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.
 
Back
Top