color text

  • Thread starter Thread starter RobcPettit
  • Start date Start date
R

RobcPettit

Hi, if I put a string into a label, label.Text = horsy[0] + "\t" + " -
" + "\t" + returns.totReturn.ToString();, is it possible to have the
'returns.totReturn.ToString()' string part in a different colur.
Regards Robert
 
Hi,

No , it;s not

You have to derive from Label and do it your self. I don't think it's a very
difficult thing to do anyway
 
I would create a custom control and then use the OnPaint method to paint the
text the user specifies. Check MSDN for creation of custom .NET controls.

Rick D.
Contractor

Ignacio Machin ( .NET/ C# MVP ) said:
Hi,

No , it;s not

You have to derive from Label and do it your self. I don't think it's a
very difficult thing to do anyway

Hi, if I put a string into a label, label.Text = horsy[0] + "\t" + " -
" + "\t" + returns.totReturn.ToString();, is it possible to have the
'returns.totReturn.ToString()' string part in a different colur.
Regards Robert
 
Hi, if I put a string into a label, label.Text = horsy[0] + "\t" + " -
" + "\t" + returns.totReturn.ToString();, is it possible to have the
'returns.totReturn.ToString()' string part in a different colur.
Regards Robert

Aside from your question (which has been answered in other replies already),
I notice you are doing:

label.Text = horsy[0] + "\t" + " - " + "\t" + ...

Why not:

label.Text = horsy[0] + "\t - \t" + ...

Mythran
 

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

Back
Top