Results 1 to 9 of 9

Thread: Adding ListBox itens (RESOLVED)

  1. #1

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364

    Adding ListBox itens (RESOLVED)

    how to add in a listView itens that start's in 1 to 50.
    I know there is an easiest way then
    VB Code:
    1. Private Sub Form_Load()
    2. List1.AddItem 1
    3. List1.AddItem 2
    4. .
    5. .
    6. .
    7. List1.AddItem 50
    8. End Sub


    Thanks
    Last edited by Daskalos; Sep 12th, 2002 at 08:46 PM.

  2. #2
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    ListBox or ListView?
    Anyways
    VB Code:
    1. 'ListBox
    2. For X = 1 To 50
    3.  List1.AddItem X
    4. Next

    VB Code:
    1. 'ListView
    2. For X = 1 To 50
    3.  ListView1.ListItems.Add ,,X
    4. Next

  3. #3

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    and if I wnat to add A to P


    thanks

  4. #4
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    There is alos an index which lets you decide where in the list to add the new item, but that may be more info than you need right now...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  5. #5
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Originally posted by Daskalos
    and if I wnat to add A to P


    thanks

    VB Code:
    1. For X = Asc("A") To Asc("P")
    2.    List1.AddItem Chr(X)
    3. Next

  6. #6

    Thread Starter
    Hyperactive Member Daskalos's Avatar
    Join Date
    Jun 2002
    Location
    Just behind YOU...
    Posts
    364
    thank you very much

  7. #7
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Can't test, but intrigues...can you use step on this code as well and skip every other letter?
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  8. #8

  9. #9
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Did not know you could do ths. Pretty cool...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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