i would like to import all data from listbox to a textbox as it looks like in listbox. (vb6)
Cheers
import all data from listbox to textbox
Page 1 of 17 Replies - 4722 Views - Last Post: 26 January 2012 - 02:04 PM
Topic Sponsor:
Replies To: import all data from listbox to textbox
#2
Re: import all data from listbox to textbox
Posted 07 August 2010 - 08:41 PM
#3
Re: import all data from listbox to textbox
Posted 10 August 2010 - 01:24 AM
I hope below code will give you some clue.
Private Sub Command1_Click()
Dim i As Integer
For i = 0 To List1.ListCount
If Text1.Text = "" Then
Text1.Text = List1.List(i)
Else
Text1.Text = Text1.Text & vbNewLine & List1.List(i)
End If
Next i
End Sub
#4
Re: import all data from listbox to textbox
Posted 10 August 2010 - 01:43 AM
perhaps a better way 
oh yea and i am pretty sure it must be to ListCount-1
Private Sub Command1_Click()
Dim i As Integer
Text1.Text =""
For i = 0 To List1.ListCount-1
Text1.Text = Text1.Text & List1.List(i)& vbNewLine
Next i
End Sub
oh yea and i am pretty sure it must be to ListCount-1
This post has been edited by NoBrain: 10 August 2010 - 01:44 AM
#5
Re: import all data from listbox to textbox
Posted 10 August 2010 - 08:22 PM
Oh yea sure it should be ListCount-1. Thankx for correction
#6
Re: import all data from listbox to textbox
Posted 05 September 2010 - 12:56 AM
NoBrain, on 10 August 2010 - 12:43 AM, said:
perhaps a better way 
oh yea and i am pretty sure it must be to ListCount-1
Private Sub Command1_Click()
Dim i As Integer
Text1.Text =""
For i = 0 To List1.ListCount-1
Text1.Text = Text1.Text & List1.List(i)& vbNewLine
Next i
End Sub
oh yea and i am pretty sure it must be to ListCount-1
Thanks 'NoBrain' that worked and problem solved
Cheers
#7
Re: import all data from listbox to textbox
Posted 25 January 2012 - 06:32 PM
Sir how about vice versa....
all the text on the textbox will transfer again to listbox...
how do i code that????
thanks in advance...
all the text on the textbox will transfer again to listbox...
how do i code that????
thanks in advance...
#8
Re: import all data from listbox to textbox
Posted 26 January 2012 - 02:04 PM
post the code that you have tried and we will try to help you
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|