I need to find a way to either put the text content of my listbox into a text file or ad lines to a text box with erasing the current content. Thanx.....
Printable View
I need to find a way to either put the text content of my listbox into a text file or ad lines to a text box with erasing the current content. Thanx.....
To put a ListBox's contents in a TextBox.
To add new new line to a TextBox, add a vbNewLine.Code:For I = 0 To List1.ListCount - 1
Text1 = Text1 & vbNewLine & List1.List(I)
Next I
Code:Text1 = Text1 & vbNewLine
Private Sub Form_Load()
For i = 1 To 10
List1.AddItem i
Next i
Text1.Text = ""
End Sub
Private Sub List1_Click()
Text1.Text = Text1.Text & List1.Text & vbCrLf
List1.RemoveItem List1.ListIndex
End Sub