PDA

View Full Version : how do i add a line when inputting into a text box in Visual Basic?


The Laughing Cow
20-01-2001, 16:59
basically i want to , when a button is clicked, display

some text but with 3 lines gap

i thought coding shud be


Private Sub Form_Load()
txtCoding.Text = "<HTML><HEAD></HEAD><BODY></BODY></HTML>"
End Sub


but obviously that only prints along the same line

i need

<HTML>
<HEAD>


bla bla

ne idea?

DeKurver
23-01-2001, 23:52
The simplest way would be:

txtCoding.Text = "<HTML>" & vbNewLine & "<HEAD>" & vbNewLine... etc.

This sort of string concatenation in VB is expensive, so it really depends on how many times you plan to do it and whether or not the performance you achieve is acceptable.

The Join function is a much better option but the code to implement it properly is a bit more involved.