Help With RichTextBox

  • Thread starter Thread starter shachar
  • Start date Start date
S

shachar

hi all.
i'm appending lines to my RichTextBox.
can i append each line in a different color? how?
 
Hi

place a richtextbox and a button on a form and copy paste this code

<<<<<<<<code>>>>>>>>>>

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim kleur As Color
For i = 0 To 10
RichTextBox1.SelectionColor = kleur.FromArgb(Rnd() * 255, Rnd()
* 255, _ Rnd() * 255)
RichTextBox1.AppendText(CStr(i) & vbCrLf)
Next
End Sub

<<<<<<<code>>>>>>>>>>

hth

grtz Peter
 

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