Dim Personas As New List(Of Persona)
Dim BuscarA = "Yuis"
Sub Prueba()
Personas.AddRange(
{New Persona With {.Nombre = "Pep", .Apellido = "Lluis"},
New Persona With {.Nombre = "Yuis", .Apellido = "Franco"},
New Persona With {.Nombre = "Juansa", .Apellido = "Yopis"},
New Persona With {.Nombre = "Marc", .Apellido = "Rubiño"}
})
Dim ficha As Persona = Personas.Find(AddressOf Buscar)
If ficha IsNot Nothing Then
MessageBox.Show(String.Format("Ficha de : {0} {1}", ficha.Nombre, ficha.Apellido))
Else
MessageBox.Show("Ficha: " & BuscarA & "Inexistente: ")
End If
End Sub
Function Buscar(ByVal p As Persona) As Boolean
If p.Nombre = BuscarA Then
Return True
Else
Return False
End If
End Function
.....
.....
Public Class Persona
Property Nombre As String
Property Apellido As String
Property Edad As Integer
End Class
;-)
Pep Lluis,