Line 1 xxxxxx Line 2 yyyyyy Line 3 mmmmmm and so on?
Also, I notice that the rich text box has a +Lines: StringArray. Can this be used to write text from variables?
Here are two button handlers that show both ways and produce the same text in the RichTextBox control:
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button1.Click RichTextBox1.Text = "Line 1 xxxxxx" + vbCrLf RichTextBox1.Text += "Line 2 yyyyyy" + vbCrLf RichTextBox1.Text += "Line 3 mmmmmm and so on?" + vbCrLf End Sub Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles Button2.Click Dim myLines(3) As String myLines(0) = "[using Lines] Line 1 xxxxxx" myLines(1) = "[using Lines] Line 2 yyyyyy" myLines(2) = "[using Lines] Line 3 mmmmmm and so on?" RichTextBox1.Lines = myLines End Sub
Dig Deeper on VB code downloads
Related Q&A from John Robbins
What is a JAD session? This term is referred to often in job postings and seems like some kind of brainstorm you carry out with a client to define IT... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.