Results 1 to 4 of 4

Thread: Get all current itens of a listbox and after it how to add a item name to a textbox??

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2007
    Posts
    145

    Get all current itens of a listbox and after it how to add a item name to a textbox??

    Get all current itens of a listbox and after it how to add a item name to a textbox??

    I'm using a code to get random things to a listbox...

    But I wanna know, when clicked at item of a listbox, how to show the name of the item at a textbox?

    I'm using this code but it works only for the first item:

    Private Sub List1_Click()
    If List1.Selected(1) Then
    Text5.Text = List1.List(1)
    End If
    End Sub

  2. #2
    Fanatic Member vbasicgirl's Avatar
    Join Date
    Jan 2004
    Location
    Manchester, UK
    Posts
    1,016

    Re: Get all current itens of a listbox and after it how to add a item name to a textbox??

    Because you know you are running that code from the click event you can just say.
    Code:
    Text5.Text = List1.Text
    Casey.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2007
    Posts
    145

    Re: Get all current itens of a listbox and after it how to add a item name to a textbox??

    OH YEAH! Thx!!!

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

    Re: Get all current itens of a listbox and after it how to add a item name to a textbox??

    Quote Originally Posted by dr4gunz
    Get all current itens of a listbox
    What do you mean by this?

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