Friday, November 19, 2010

In VB how can you make the program count up every time you click a box?

I need the command to make the computer count for me. it's a project involving albums and i need a display counter showing how many albums i've clicked on so far. Does that make sense? So like click one, it says 1. click a second it will say 2, but i have to make it so you can click them in any order not in the order they are presented.In VB how can you make the program count up every time you click a box?
Simple, just like this:



Dim x As New Random()

For I As Int32 = 0 To 20

Dim y As Double = (x.Next(1, 1000) / 1000)

Me.CheckedListBox1.Items. Add(y, y %26lt; 0.5)

Next



Me.Text = Me.CheckedListBox1. CheckedItems. CountIn VB how can you make the program count up every time you click a box?
Use a label or a text box to store the incremented value...in the onclick event for each picture or button, set the incrementation up.

No comments:

Post a Comment