How to print an array in Richtext box
Hi All,
I want to print the elements of array in rich text box. And i want each element of array to be in new line.
so i achieved tat with this piece of code
In sub routine
arr(0) = "Here"
arr(1) = "Pencils"
arr(2) = "String"
RichTextBox1.Text = (arr(0) & vbCrLf & arr(1) & vbcrlf & arr(2))
But if there are 100 elements, it will be too lengthy.
So is there anyway that i can give the array address and it prints in new line.
Say like RichTextBox1.Text = &arr
or put in a if loop .???
I tried it but could not make it,
Can anyone help me please....??
:(
Re: How to print an array in Richtext box
hey try to use varible and increment it.
Re: How to print an array in Richtext box
I tried like this
For i = 0 To 3
RichTextBox1.Text = (arr(i) & vbCrLf)
i = i + 1
Next
But the values are overlapping
Mean only last array element is getting printed
Re: How to print an array in Richtext box
hye just a small change in ur code reqd...
For i = 0 To 3
RichTextBox1.Text = [B]RichTextBox1.Text & [/B]arr(i) & vbCrLf
i = i + 1
Next