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

Copy items from listbox to label array?

$
0
0
Hi there! I am working on a math game with wild numbers. I am
VB Code:
  1. 'This code copies the wild numbers to the big window
  2. ShowWildNumbers.Show
  3. Dim lIndex As Long
  4.    If WildList.ListCount Then
  5.       lIndex = Int(Rnd * WildList.ListCount)
  6. Dim i As Integer
  7. For i = 0 To 5
  8.     ShowWildNumbers.WildNumbLBL(i).Caption = WildList.List(i - 1)
  9. Next
  10.      
  11.    End If

It works great, but the issue is I don't want just the first 6 items copied, but the whole list box, the problem is sometimes the listbox could have 5 items, 10, or even 13. I definitely will always have enough label captions, but is there a way for the listbox to copy whatever is in there?

Thanks a lot!!

Viewing all articles
Browse latest Browse all 21238

Trending Articles



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