Geeks Talk

Prepare for your Next Interview




How to print an array in Richtext box

This is a discussion on How to print an array in Richtext box within the VB.NET forums, part of the Software Development category; 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 ...


Go Back   Geeks Talk > Software Development > VB.NET

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-01-2007
Contributing Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 44
Thanks: 6
Thanked 7 Times in 6 Posts
prakash.kudrekar is on a distinguished road
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....??

Reply With Quote
The Following User Says Thank You to prakash.kudrekar For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 05-01-2007
Contributing Member
 
Join Date: Feb 2007
Location: hyderabad,india
Posts: 34
Thanks: 0
Thanked 4 Times in 4 Posts
raafay is on a distinguished road
Re: How to print an array in Richtext box

hey try to use varible and increment it.
Reply With Quote
  #3 (permalink)  
Old 05-01-2007
Contributing Member
 
Join Date: Apr 2007
Location: Bangalore
Posts: 44
Thanks: 6
Thanked 7 Times in 6 Posts
prakash.kudrekar is on a distinguished road
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
Reply With Quote
  #4 (permalink)  
Old 12-26-2007
Junior Member
 
Join Date: Dec 2007
Location: india
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
nitin_padwal is on a distinguished road
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 = RichTextBox1.Text & arr(i) & vbCrLf
i = i + 1
Next
Reply With Quote
Reply

  Geeks Talk > Software Development > VB.NET


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
Validate Print button in webbased application JobHelper QTP 3 07-15-2008 08:31 AM
Help on Dynamic Array nancyphilips C and C++ 8 12-25-2007 09:59 AM
convert one dimansional array to two dimansional array Geek_Guest C and C++ 6 12-22-2007 04:17 AM
I forget my print server password Geek_Guest PeopleSoft 0 04-11-2007 01:40 PM
cursor to array. Barbie Oracle 1 02-06-2007 08:57 AM


All times are GMT -4. The time now is 12:32 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved