Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

richtextbox

Status
Not open for further replies.

amsh7

Programmer
May 27, 2002
18
0
0
US
as you look at the code below, I want to chnge the color of each line. why it is not working ? even when using the selstart and sellength it change only to 1 color.

Thank You
Amos
RichTextBox1.SelColor = vbRed
RichTextBox1.Text = RichTextBox1.Text & "aaaaaaaaaaaaaaaaaaaaaaa"
RichTextBox1.SelColor = vbGreen
RichTextBox1.Text = RichTextBox1.Text & "bbbbbbbbbbbbbbbbbbbbbb"
RichTextBox1.SelColor = vbBlue
RichTextBox1.Text = RichTextBox1.Text & "ccccccccccccccccccccccc"

 

You were so close...

Try this...
[tt]
RichTextBox1.SelColor = vbRed
RichTextBox1.SelText = "aaaaaaaaaaaaaaaaaaaaaaa" & vbNewLine
RichTextBox1.SelColor = vbGreen
RichTextBox1.SelText = "bbbbbbbbbbbbbbbbbbbbbb" & vbNewLine
RichTextBox1.SelColor = vbBlue
RichTextBox1.SelText = "ccccccccccccccccccccccc" & vbNewLine
[/tt]

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top