Show all Properties of a class

I want to have all properties of a class in a listbox with the name of the property in one column and the value of the property in a other column. Anybody a idea? I tried it with inspection, but I don´t find a way that works.

Regards

Jens

Introspection is about the only way you can do this without just hard coding a list.

Recall that some properties are inherited so they may not exist directly on the class you inspecting and may be on the parent class

Here this should help as a starting point

[code] Dim myProperties() as Introspection.PropertyInfo = Introspection.GetType(oSource).GetProperties
Dim t as Introspection.TypeInfo = Introspection.GetType(oSource)

dim y as integer
For y =0 to Ubound(myProperties)
myProperties(y).Value(oCopy)=myProperties(y).Value(oSource)
Next[/code]

Thanks for the the starting point. I now reached 50% of what I want. I now have the name in the listbox, but putting the value in the listbox crash.

Dim myProperties() as Introspection.PropertyInfo = Introspection.GetType(CBolt1).GetProperties
Dim t as Introspection.TypeInfo = Introspection.GetType(CBolt1)
dim y as Integer
For y =0 to Ubound(myProperties)
self.Result1.ListBox1.AddRow
self.Result1.ListBox1.Cell(self.Result1.ListBox1.LastIndex, 0) =myProperties(y).Name
self.Result1.ListBox1.Cell(self.Result1.ListBox1.LastIndex, 1) =cstr(myProperties(y).Value)
Next

well you need to use introspection to check if its readable, data type etc.
put the value in a variant first

Hi

I found a solution. The following source code lists all properties of the class Cname with name and value in a listbox with two columns. It don´t works with arrays. But that is ok for me.

Dim myProperties() as Introspection.PropertyInfo = Introspection.GetType(Cname).GetProperties
dim y as UInt16
For y =0 to Ubound(myProperties)-2
self.Result1.ListBox1.AddRow
self.Result1.ListBox1.Cell(self.Result1.ListBox1.LastIndex, 0) =myProperties(y).Name
self.Result1.ListBox1.Cell(self.Result1.ListBox1.LastIndex, 1) =cstr(myProperties(y).Value(Cname))
Next