Listbox
Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
4 posts
Page 1 of 1
Well what you could do if I understand you right:
under Public class put these codes:
(should be Listbox1_SelectedIndexChanged)
under Public class put these codes:
Code: Select all
Then double click ListBox1 and put these codes:Dim nr1 As String = "-1"
Dim nr2 As String = "-2"
Dim nr3 As String = "-3"
Dim nr4 As String = "-4"
Dim nr5 As String = "-5"
Dim nr8 As String = "-8"
(should be Listbox1_SelectedIndexChanged)
Code: Select all
If ListBox1.Text = "Game" Then
ListBox2.Items.Add(nr1 & vbNewLine)
ListBox2.Items.Add(nr2 + vbNewLine)
ListBox2.Items.Add(nr3 + vbNewLine)
If ListBox2.Items.Contains(nr4) Then
ListBox2.Items.Remove(nr4)
End If
If ListBox2.Items.Contains(nr5) Then
ListBox2.Items.Remove(nr5)
End If
If ListBox2.Items.Contains(nr8) Then
ListBox2.Items.Remove(nr8)
End If
Else
If ListBox1.Text = "No game" Then
If ListBox2.Items.Contains(nr1) Then
ListBox2.Items.Remove(nr1)
End If
If ListBox2.Items.Contains(nr2) Then
ListBox2.Items.Remove(nr2)
End If
If ListBox2.Items.Contains(nr3) Then
ListBox2.Items.Remove(nr3)
End If
ListBox2.Items.Add(nr4 & vbNewLine)
ListBox2.Items.Add(nr5 + vbNewLine)
ListBox2.Items.Add(nr8 + vbNewLine)
End If
End If
Yes like that but when you click on it 'game' 2 times it duplicate... and so on with no game to
Maybe you could call Listbox.Items.Clear on the listbox you aren't clicking on before you add the items?
4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023