Results 1 to 36 of 36

Thread: [RESOLVED] Loop through listview adding items

Hybrid View

  1. #1
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: [RESOLVED] Loop through listview adding items

    NW, In a FOR loop, the counter variable is automaically incremented by 1 (default). There is no need of incrementing it by yourself !
    Quote Originally Posted by http://www.vb6.us/tutorials/understanding-do-and-while-loops
    By default, the variable used in the declaration of the For-Next loop is incremented by 1 each time through the loop; however, if you want to increment this value by a different amount each time through the loop, you can simply append Step (Integer) to the end of the For-Next loop declaration.
    ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  2. #2

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: [RESOLVED] Loop through listview adding items

    Quote Originally Posted by akhileshbc View Post
    NW, In a FOR loop, the counter variable is automaically incremented by 1 (default). There is no need of incrementing it by yourself !
    Yeah, I know! However, for some reason it does not increment the value automatically.

    Edit:

    Although, the code using a "For" statement in my original post works as it should.

    Edit:

    I just tried this code and it works! I reckon the "done" event of the pop component is causing the problem or maybe I need to download the component again.

    vb Code:
    1. Private Sub Form_Load()
    2.     Dim i As Integer
    3.     For i = 1 To 10
    4. Me.Caption = LstNewMail.ListItems.Add(, , i)
    5.     Next i
    6. End Sub
    Last edited by Nightwalker83; Sep 1st, 2010 at 07:11 AM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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