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

Show a label caption with what was added to a listbox?

$
0
0
Hi there folks! I am working on a game for the students where numbers with a specific number at the right end of it is removed from one listbox (the uncalled list), and put into another listbox of called numbers (calledlist).

This is how it works.

VB Code:
  1. Dim i As Integer
  2. 'For i = 0 To UncalledList.ListCount - 1
  3. For i = UncalledList.ListCount - 1 To 0 Step -1
  4. If Right(UncalledList.List(i), 1) = "1" Then CalledList.AddItem UncalledList.List(i)
  5.  
  6. Next i

What I would like to add, is just whatever numbers were added to the calledlist, show up also in label captions to make it easier for the students to see them.

the problem is though, sometimes 5 numbers might be called, sometimes 8, but never more than 8 though. I can make an array of label captions, but if the number is going to change as far as how many are needed, won't that give me errors.

See I would like to have it show whatever was called over right after it was called over. So maybe add this line below the If right statement?

WildNumbLBL(i).Caption = CalledList.List(i)

See that would then present another problem, if it did that each time, it would also show the numbers called over from the previous turns as well???

I do need to keep all previous calls in the called list, but just the ones called each turn to show up in a label caption, but would anyone know of a way to do that? :) :)

Thanks!!!!

Viewing all articles
Browse latest Browse all 21114

Trending Articles



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