Idk about VB6, but it Java, you use a for each loop.
I'm sure someone will give you an exact answer, but look up for each loops.
I've been working on a program for a few days and I think I'm almost done, but since this is all my coding experience, I'm not good and rely mostly on tutorials. I just need some help getting my listbox items to be chosen automatically, at the moment I have to click on each one of the items and then click on the command button to get it to work. Should I use a different approach for the text list itself or..?
Also, looping is somehow a problem for me -.-
Thanks
Idk about VB6, but it Java, you use a for each loop.
I'm sure someone will give you an exact answer, but look up for each loops.
Do until x = lstBox.listcount - 1
code here
x = x + 1
loop
SmileYaDead (03-29-2012)
Last edited by Zachafer; 03-29-2012 at 07:16 PM.
SmileYaDead (03-29-2012)
Thanks, I'll put this in tomorrow, need some sleep.
How would these be in the VB 2010 version?
Close to the same:
Or even a for loop:Code:Dim x = 0 Do While x < lstBox.Items.Count 'code here x += 1 Loop
In these cases, x is an index of the listbox.Code:For x As Integer = 0 To lstBox.Items.Count - 1 'code here Next x
You access the string in the listbox by lstBox.Items(index)