Thread: ListBox

Results 1 to 6 of 6
  1. #1
    -[Nero..x3's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    15

    ListBox

    Sorry about making many posts.
    Is it possible to make the ListBox Items numbered?
    I mean, I have over 100 items in the list box.
    I'm using a code like: If ListBox1.SelectedItem="Hello,..." Then..
    But I don't want to write that Hello for every item, since I wanna make an "If" thing for every item.
    Can I make a code like:

    'If ListBox1. [First Item Selected] Then
    ...
    End If'
    Or
    'If ListBox1. Item Number 1 Selected Then
    ...
    End if'

    And same for Second item, third item... 50th, 80th, 100th item.
    And sorry if that's an idiot question but i'm still learning this language. : )
    Thank you.

  2. #2
    Dab's Avatar
    Join Date
    Jun 2015
    Gender
    female
    Posts
    5,426
    Reputation
    663
    Thanks
    9,873

  3. #3
    -[Nero..x3's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    15
    That code you gave me gives me the item No. 4
    But I want to get the number of the selected item.
    Last edited by -[Nero..x3; 08-27-2015 at 06:12 AM.

  4. #4
    Dab's Avatar
    Join Date
    Jun 2015
    Gender
    female
    Posts
    5,426
    Reputation
    663
    Thanks
    9,873
    Quote Originally Posted by -[Nero..x3 View Post
    That code you gave me gives me the item No. 4
    But I want to get the number of the selected item.
    Did you read I said? I already told you that X will determine each item's number in the count. All you have to do is check if Item's index matches your selected items index. Also you need to -1 on my count loop so it doesn't go over the possible number of items in the loop


  5. #5
    -[Nero..x3's Avatar
    Join Date
    Jul 2015
    Gender
    male
    Posts
    89
    Reputation
    10
    Thanks
    15
    Yea I got it now, sorry for being an idiot / still learning VB.

  6. #6
    AuT03x3C's Avatar
    Join Date
    Nov 2014
    Gender
    male
    Location
    kernel32.dll
    Posts
    453
    Reputation
    11
    Thanks
    4,561
    My Mood
    Sleepy
    Just use listbo*****lectedIndex.

Similar Threads

  1. [help Plz]how do i download from a listbox
    By trevor206 in forum Visual Basic Programming
    Replies: 4
    Last Post: 12-06-2009, 04:46 PM
  2. [HELP]DLL path = Listbox...
    By theavengerisback15 in forum Visual Basic Programming
    Replies: 6
    Last Post: 11-30-2009, 02:50 PM
  3. [HELP]Listbox = selecteditem, how to..
    By theavengerisback15 in forum Visual Basic Programming
    Replies: 3
    Last Post: 11-30-2009, 08:31 AM
  4. ListBox/Injector Help
    By MinimalKills in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-15-2009, 12:20 PM
  5. [TuT] Cycling through items in a listbox [/TuT]
    By That0n3Guy in forum Visual Basic Programming
    Replies: 2
    Last Post: 09-07-2009, 09:29 AM