Results 1 to 5 of 5

Thread: [RESOLVED] textbox to listbox VB6.0

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Resolved [RESOLVED] textbox to listbox VB6.0

    ei, sir i need some little help, i have a set of strings in my textbox = 12,egt,342,jkls9,10 and i want them to be added into listbox without the commas.

    Output should be

    List1.listindex(0) = 12
    List1.listindex(1) = egt
    List1.listindex(2) = 342

    and so on...

    please help thanx...

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Re: textbox to listbox VB6.0

    Thanx for the PM advice from hack, I hope you could find some piece of code for it...

  3. #3
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: textbox to listbox VB6.0

    Something like this,

    VB Code:
    1. Private Sub Command1_Click()
    2.  
    3. Dim i As Integer
    4.  
    5.     For i = 0 To List1.Count - 1
    6.         List1(i).AddItem Split(Text1.Text, ",")(i)
    7.     Next i
    8.  
    9. End Sub
    10.  
    11. Private Sub Form_Load()
    12.  
    13.     Text1.Text = "12,egt,342,jkls9,10"
    14.  
    15. End Sub

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: textbox to listbox VB6.0

    VB Code:
    1. Private Sub Command1_Click()
    2. Dim i As Long
    3. Dim arrString() As String
    4. arrString = Split(Text1.Text, ",")
    5. For i = 0 To UBound(arrString)
    6.     List1.AddItem arrString(i)
    7. Next
    8. End Sub

  5. #5

    Thread Starter
    New Member
    Join Date
    Jan 2006
    Posts
    3

    Re: [RESOLVED] textbox to listbox VB6.0

    Thankyou verymuch....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width