Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

[RESOLVED]list box loop scrowlling from first item to last one on command click

$
0
0
hi again everyone , does anyone know how to do a loop to a list1 box with data and declare that data as a variable ?

i am stuck in listindex commands .

This code is just to add some examples on list
Private Sub Form_Load()
Dim a As String
a = 1
For i = 1 To 100
Do Until List1.ListCount = 100
a = a + 1
List1.AddItem a
Loop
Next
End Sub

Now , on command1 click i want that a loop start from the beginning of the list1 start loop until end , but without knowing how many numbers are really on the list , what i want is that in the end of last list count the loop stops .

How can i do that .
I am sure is a simple code to do it , but sometimes i get stuck in these simple code lines .

Thanks

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>