Click here to Skip to main content
15,905,238 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wanted to have multiple color for text in single label controller

e.g.

label1.Text = " $ 480.00 "

What I want is character $ in Red color and other digits or character after $ in color blue.

I cannot have separate labels for digits and $.
Posted

1 solution

You can't really have this in a single winforms textbox. You either need to use a richtextbox, or you need to override the paint event in the original textbox. If you were using WPF, you could use a TextBlock, and have different runs to get the desired effect.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900