I have a class (card) with various properties. I also have another class (cardcollection) which is a collection of a bunch of objects of the type card. I use a for loop to display the text property of the class in a list box of each object of the type card class.
what i want to do is click a button and a text box changes to the text property of a random object within the cardcollection class.
if this is more than can be explained here then please give me the words i need to Google to do this. i know .net has things built in for randomization, i just don't know how to use it, or what it is called to research it.
thanks,
2007-01-23
18:49:58
·
1 answers
·
asked by
Jamie J
3
in
Computers & Internet
➔ Programming & Design
The code i use to view objects in the different objects of type "card" class; in a combo box, list box, and 3 text boxes. this part does not need randomization. another part of the app does.
Dim _cardcollec As CardCollection
For i As Integer = 0 To _cardcollec.Count - 1
Dim _card As Card
_card = _cardcollec.Item(i)
If Not cmbCategory.Items.Contains(_card.Category) Then
cmbCategory.Items.Add(_card.Category) 'adds catagories to combo box
End If
If _card.Category = cmbCategory.SelectedItem Then
lstCardList.Items.Add(_card)
End If
Next
2007-01-23
18:52:30 ·
update #1