Hola a todos
Tengo este problema con el siguiente código
Dim type As Type = Me.MaskedTextBox1
Dim prop As System.Reflection.PropertyInfo
Dim obj As Object
Dim returnValue As Object
For Each prop In type.GetProperties
Try
returnValue = prop.GetValue(obj, Nothing)
Me.ListBox1.Items.Add(prop.Name + "=" + returnValue.ToString)
Catch ex As System.Reflection.TargetException
End Try
Next
El problema es que siempre se genera la Exception
System.Reflection.TargetException
Si alguien me puede ayudar le agradecería
Nota: El objetivo de este algoritmo es rellenar un ListBox con las
propiedades y sus valores de un objeto
Muchas Gracias
Pablo
Leer las respuestas