Loop Application

dan463va

Member
Joined
Sep 25, 2006
Messages
7
Programming Experience
Beginner
Hey I'm new here and have an application i'm working on, i've just started with Visual Basic. One of the exercises asked us to make a List Box that uses a Loop. The user can type a number (The Upper Limit) into a text box and then the ListBox will go through the numbers until the upper limit is reach giving the number, that number squared and then then number cubed in the list box. Can anyone give me help with this?
 
so you want a listbox that stores a bunch of numbers, then when the user types in a number in a textbox the listbox selects the number then the selected number is ^2 then ^4?

if so, then the key here is the listbox's selectedindex property is your friend

Listbox1.SelectedIndex = Cint(Textbox1.Text) is an example of selecting the number in the listbox from the textbox
 
This is your owrk, not ours. What do you know about loops so far? What sort of loops are there? You have a finite number of iterations to make in your loop. What type of loop is best for that?
 
Back
Top