1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Public Structure wKey
Dim k1 As String
Dim k2 As String
End Structure
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim key1 As wKey
Dim key2 As wKey
Dim L As New ArrayList
L.Clear()
key1.k1 = "Paul"
key1.k2 = "Newman"
key2.k1 = "Robert"
key2.k2 = "Mitchum"
L.Add(key1)
L.Add(key2)
If L.Contains(key1) Then 'yatil Paul Newman ?
MsgBox("true") ' Oui bien sur
Else
MsgBox("false")
End If
key1.k1 = "John"
If L.Contains(key1) Then 'yatil John Newman ?
MsgBox("true")
Else
MsgBox("false") 'non bien sur
End If
End Sub
End Class |
Partager