Results 1 to 2 of 2

Thread: Help! (For Next, ListBox)

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    8

    Post

    I am taking an introduction to Visual Basic 6.0 class at a community college. The program I'm working on will calculate payments for a car loan. This exercise requires that the various interest rates be displayed in a listbox. Rather than keying in each entry, I want the program to figure out all the values using the For Next statement with values of 7.00% to 12.00% in steps of .25%, then add those values to the ListBox when the program loads. Appreciate an example!

  2. #2
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    Try something like this:

    Code:
    Private Sub Command1_Click()
        Dim i As Single
        List1.Clear
        For i = 7 To 12 Step 0.25
            List1.AddItem i
        Next i
    End Sub
    Be sure to have a button (Command1) and a listbox (List1)

    All that really does when you click on Command1 is put values in the listbox like:
    7
    7.25
    7.5
    7.75
    8
    8.25, etc.

    ------------------
    Tom Young, 14 Year Old
    [email protected]
    ICQ: 15743470 Add Me ICQ Me
    AIM: TomY10
    PERL, JavaScript and VB Programmer

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