List Boxes, Moving Items (Removing Then Adding)
Posted on 2005-03-24
I'm sure you will know what this code does...
Private Sub cmdP1BuyHood_Click()
Dim I As Integer
If lstBank.ListIndex = -1 Then Exit Sub
For I = lstBank.ListCount - 1 To 0 Step -1
If lstBank.Selected(I) = True Then
Well its for a monopoly game. I have 3 list boxes. The code above removes an item from the Bank list box and adds it to player 1's list box. Its not exactly what I need. I need to select 1 of 24 items in the list box and then click the command button however this obviously gives the user the choice of property. I only want them to be able to purchase the property they have
So when the BUY button is pressed they buy the current property which is also displayed on a picture box using text boxes and
labels. I cant get my head around how I go about doing this but what I'm thinking is pressing the BUY button, checking the 'Title' of the property in the label and using this to add this property's item to the players list of bought property and removing it from the banks list. Is this possible and how would I do it?
So I have a command button, a list box holiding the property, a list box holding the players bought property at first empty, a picture box holding a label and text boxes with 1 label which holds the propertys name that is currently occupied.