Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 244,284 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,016 people online right now. Registration is fast and FREE... Join Now!




.appendtext into a new richtextbox line

 
Reply to this topicStart new topic

.appendtext into a new richtextbox line

TerraEnvy
10 Nov, 2008 - 03:53 AM
Post #1

New D.I.C Head
*

Joined: 7 Nov, 2008
Posts: 19



Thanked: 1 times
My Contributions
kay so what I need to know is how do you make a line appear on line one, and then make the next one on line 2
Here is the code I am using
CODE

"Needs to be on line 1"
RichTextBox2.AppendText(lines2(line2_1).Trim()
"Needs to be on line 2"
RichTextBox2.AppendText(lines2(line2_2).Trim())


I am still new to VB.net so either
(Environment.NewLine)
and
vbcrlf
dont work for this format or I did it wrong.
thanks for any help
-Terra

User is offlineProfile CardPM
+Quote Post


PsychoCoder
RE: .appendtext Into A New Richtextbox Line
10 Nov, 2008 - 07:25 AM
Post #2

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,283



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
I would try it this way

vb

"Needs to be on line 1"
RichTextBox2.Text = lines2(line2_1).Trim() + Environment.NewLine
"Needs to be on line 2"
RichTextBox2.Text &= lines2(line2_2).Trim() + Environment.NewLine


Hope that helps smile.gif
User is offlineProfile CardPM
+Quote Post

TerraEnvy
RE: .appendtext Into A New Richtextbox Line
10 Nov, 2008 - 12:48 PM
Post #3

New D.I.C Head
*

Joined: 7 Nov, 2008
Posts: 19



Thanked: 1 times
My Contributions
QUOTE(PsychoCoder @ 10 Nov, 2008 - 07:25 AM) *

I would try it this way

vb

"Needs to be on line 1"
RichTextBox2.Text = lines2(line2_1).Trim() + Environment.NewLine
"Needs to be on line 2"
RichTextBox2.Text &= lines2(line2_2).Trim() + Environment.NewLine


Hope that helps smile.gif


Thank you this is exactly what I needed.
I can't believe that I forgot to put the + before environment.

I did mine a bit differently but you gave me what I needed to make it work

CODE

RichTextBox1.AppendText(lines(line).Trim() + Environment.NewLine)
        RichTextBox1.AppendText(lines2(line2_1).Trim())
        RichTextBox1.AppendText(lines2(line2_2).Trim() + Environment.NewLine)
        RichTextBox1.AppendText(lines3(line3_1).Trim())
        RichTextBox1.AppendText(lines3(line3_2).Trim())
        RichTextBox1.AppendText(lines3(line3_3).Trim() + Environment.NewLine)
        RichTextBox1.AppendText(lines4(line4_1).Trim())
        RichTextBox1.AppendText(lines4(line4_2).Trim())
        RichTextBox1.AppendText(lines4(line4_3).Trim())
        RichTextBox1.AppendText(lines4(line4_4).Trim() + Environment.NewLine)


I have a question for you if you know. As you can see I have multiple generated text on same line in some, do you know how to make it put spaces between them?
Thanks again
-Terra
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: .appendtext Into A New Richtextbox Line
10 Nov, 2008 - 12:53 PM
Post #4

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,283



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Sure, as an example

vb

RichTextBox1.AppendText(lines3(line3_1).Trim() & " ")
RichTextBox1.AppendText(lines3(line3_2).Trim())

User is offlineProfile CardPM
+Quote Post

TerraEnvy
RE: .appendtext Into A New Richtextbox Line
10 Nov, 2008 - 02:03 PM
Post #5

New D.I.C Head
*

Joined: 7 Nov, 2008
Posts: 19



Thanked: 1 times
My Contributions
QUOTE(PsychoCoder @ 10 Nov, 2008 - 12:53 PM) *

Sure, as an example

vb

RichTextBox1.AppendText(lines3(line3_1).Trim() & " ")
RichTextBox1.AppendText(lines3(line3_2).Trim())


Thank you so much I have now, because of your help, Finished my program happy.gif
-Terra
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 03:01PM

Live VB.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month