Not sure what I am doing wrong here but I have 2 buttons and a rich text box. The issue is when I click the second button to add text to the rich text box and it over writes the current text that is already in the rich text box. How can I code this second button so that the text is added to the rich text box and not replacing the current text?
Here's my code:
Also how can I add spaces in a line of text (or in the middle of a sentence) so that I can insert a variable in the line.
Example: "This is the" variable1 "line of text"
"This is the" variable2 "line of text"
Here's my code:
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RichTextBox1.Text = "This is the first line"
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
RichTextBox1.Text = "This is the second line"
End Sub
End Class
Also how can I add spaces in a line of text (or in the middle of a sentence) so that I can insert a variable in the line.
Example: "This is the" variable1 "line of text"
"This is the" variable2 "line of text"