more than one color in textbox.

genu

Well-known member
Joined
Jun 9, 2005
Messages
94
Programming Experience
1-3
how do you get more than one color to show in a textbox. Fore examples:

a textbox has the following: "Hello World"

How do I make "Hello" Blue and "World" Red
 
i tried doing that with a label and i got it to work with 1 exception

unfortunatly the label has the autosize property that persists regardless so it always displays half of the last character but anyways you could make a new textbox or use the RichTextBox and use the selectioncolor to change certian characters different colors
 
it should already be in the toolbox in the form designer

the one provided comes with the .net framework and you dont need to include the com object with the application

here's the name space:
System.Windows.Forms.RichTextBox
 
Back
Top