Click to See Complete Forum and Search --> : Help! (For Next, ListBox)
Arda Jackson
Nov 28th, 1999, 12:08 AM
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!
Compwiz
Nov 28th, 1999, 12:25 AM
Try something like this:
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
tyoung@stny.rr.com
ICQ: 15743470 (http://wwp.icq.com/15743470) Add Me (http://wwp.icq.com/scripts/search.dll?to=15743470) ICQ Me (http://wwp.icq.com/scripts/contact.dll?msgto=15743470)
AIM: TomY10 (http://www.aol.com/aim/aim30.html)
PERL, JavaScript and VB Programmer
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.