P
playguin
Guest
when we select one option the listbox1 then that relevant photo goes to picture box . then the value of that picture in then picture box moves to listbox2.if we change a picture in the picture box how to removes value on listbox2 ?
Public Class Form1
Dim rosa(11) As String
Dim c(11) As Integer
Dim x As Integer
Dim trovato As Boolean
Dim j As Integer
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rosa(0) = "Andrea Pirlo"
rosa(1) = "Beckem"
rosa(2) = "Marcelo"
rosa(3) = "Ronaldinho"
rosa(4) = "Cristiano Ronaldo"
rosa(5) = "Moharmed Salah"
rosa(6) = "Luis"
rosa(7) = "Lionel Messi"
rosa(8) = "Eden Hazard"
rosa(9) = "Neymar"
rosa(10) = "Zlatan"
rosa(11) = "Davide"
For i = 0 To 11
ListBox1.Items.Add(rosa(i))
Next
For i = 0 To 11
c(i) = 99
Next
For i = 0 To 11
ListBox2.Items.Add(c(i))
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
trovato = False
For i = 0 To 11
If ListBox1.SelectedIndex = c(i) Then
trovato = True
End If
Next
If trovato = False And x > 0 Then
' MsgBox("NON trovato")
c(j) = ListBox1.SelectedIndex
j = j + 1
If x = 1 Then
player1.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 2 Then
player2.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 3 Then
player3.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 4 Then
player4.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 5 Then
player5.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 6 Then
player6.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 7 Then
player7.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 8 Then
player8.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 9 Then
player9.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 10 Then
player10.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 11 Then
player11.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
x = 0
Else
'MsgBox("Trovato")
End If
ListBox2.Items.Clear()
For i = 0 To 11
ListBox2.Items.Add(c(i))
Next
Label1.Text = ListBox1.SelectedIndex
End Sub
Private Sub player1_Click(sender As System.Object, e As System.EventArgs) Handles player1.Click
x = 1
End Sub
Private Sub player2_Click(sender As System.Object, e As System.EventArgs) Handles player2.Click
x = 2
End Sub
Private Sub player3_Click(sender As System.Object, e As System.EventArgs) Handles player3.Click
x = 3
End Sub
Private Sub player4_Click(sender As System.Object, e As System.EventArgs) Handles player4.Click
x = 4
End Sub
Private Sub player5_Click(sender As System.Object, e As System.EventArgs) Handles player5.Click
x = 5
End Sub
Private Sub player6_Click(sender As System.Object, e As System.EventArgs) Handles player6.Click
x = 6
End Sub
Private Sub player7_Click(sender As System.Object, e As System.EventArgs) Handles player7.Click
x = 7
End Sub
Private Sub player8_Click(sender As System.Object, e As System.EventArgs) Handles player8.Click
x = 8
End Sub
Private Sub player9_Click(sender As System.Object, e As System.EventArgs) Handles player9.Click
x = 9
End Sub
Private Sub player10_Click(sender As System.Object, e As System.EventArgs) Handles player10.Click
x = 10
End Sub
Private Sub player11_Click(sender As System.Object, e As System.EventArgs) Handles player11.Click
x = 11
End Sub
End Class
Continue reading...
Public Class Form1
Dim rosa(11) As String
Dim c(11) As Integer
Dim x As Integer
Dim trovato As Boolean
Dim j As Integer
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
rosa(0) = "Andrea Pirlo"
rosa(1) = "Beckem"
rosa(2) = "Marcelo"
rosa(3) = "Ronaldinho"
rosa(4) = "Cristiano Ronaldo"
rosa(5) = "Moharmed Salah"
rosa(6) = "Luis"
rosa(7) = "Lionel Messi"
rosa(8) = "Eden Hazard"
rosa(9) = "Neymar"
rosa(10) = "Zlatan"
rosa(11) = "Davide"
For i = 0 To 11
ListBox1.Items.Add(rosa(i))
Next
For i = 0 To 11
c(i) = 99
Next
For i = 0 To 11
ListBox2.Items.Add(c(i))
Next
End Sub
Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
trovato = False
For i = 0 To 11
If ListBox1.SelectedIndex = c(i) Then
trovato = True
End If
Next
If trovato = False And x > 0 Then
' MsgBox("NON trovato")
c(j) = ListBox1.SelectedIndex
j = j + 1
If x = 1 Then
player1.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 2 Then
player2.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 3 Then
player3.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 4 Then
player4.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 5 Then
player5.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 6 Then
player6.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 7 Then
player7.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 8 Then
player8.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 9 Then
player9.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 10 Then
player10.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
If x = 11 Then
player11.Image = ImageList1.Images(ListBox1.SelectedIndex)
End If
x = 0
Else
'MsgBox("Trovato")
End If
ListBox2.Items.Clear()
For i = 0 To 11
ListBox2.Items.Add(c(i))
Next
Label1.Text = ListBox1.SelectedIndex
End Sub
Private Sub player1_Click(sender As System.Object, e As System.EventArgs) Handles player1.Click
x = 1
End Sub
Private Sub player2_Click(sender As System.Object, e As System.EventArgs) Handles player2.Click
x = 2
End Sub
Private Sub player3_Click(sender As System.Object, e As System.EventArgs) Handles player3.Click
x = 3
End Sub
Private Sub player4_Click(sender As System.Object, e As System.EventArgs) Handles player4.Click
x = 4
End Sub
Private Sub player5_Click(sender As System.Object, e As System.EventArgs) Handles player5.Click
x = 5
End Sub
Private Sub player6_Click(sender As System.Object, e As System.EventArgs) Handles player6.Click
x = 6
End Sub
Private Sub player7_Click(sender As System.Object, e As System.EventArgs) Handles player7.Click
x = 7
End Sub
Private Sub player8_Click(sender As System.Object, e As System.EventArgs) Handles player8.Click
x = 8
End Sub
Private Sub player9_Click(sender As System.Object, e As System.EventArgs) Handles player9.Click
x = 9
End Sub
Private Sub player10_Click(sender As System.Object, e As System.EventArgs) Handles player10.Click
x = 10
End Sub
Private Sub player11_Click(sender As System.Object, e As System.EventArgs) Handles player11.Click
x = 11
End Sub
End Class
Continue reading...