Create a new line on visual basic text box

Status
Not open for further replies.

Mike9182

In Runtime
Messages
258
Location
Altoona, PA
I am making a chat bot like jay_bo said about. I created a textbox and set it to be multi line. How can I set it so that new responses are written to the next line instead of just being added to the end of what is there? I tried to use the visual basic how to, and found something about carriage return and line ending's being embedded, but couldn't figure out how to use them.

I am trying to start learning visual basic, so I am probably gonna have a lot more questions.

Tia
 
Environment.NewLine()


Example.

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = TextBox1.Text + "heyllo " & Environment.NewLine
End Sub
End Class

I would recommend a list box instead of a textbox if your going to use it as like a log?
 
What you might want to do is have a read-only multi-line textbox and a normal editable textbox. Everytime a user enters data into the textbox and presses "send", or whatever you have designated as your processing action, and then it can append to existing test in the read-only textbox after adding the carriage return. that way, it will work more like your typical IM application.
 
Status
Not open for further replies.
Back
Top Bottom