"Brent" <Br***@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
I created a structure with several variables in it.
I wanted to add all the variables of the structure into a listbox. Is
there
a way I can do this in some kind of loop rather than having to type in 26
item.add lines. How does the Intellisence figure out and list out the
variables?
Thanks
Brent
Dim st As MyStruct
Dim tp As System.Type = st.GetType()
Dim s As String
Console.WriteLine("Definition: " & tp.Name & " - " & tp.ToString())
Console.WriteLine("Members")
Console.WriteLine("-------")
For Each fi As Reflection.FieldInfo In tp.GetFields()
Console.WriteLine(Space(4) & fi.Name & " As " &
fi.MemberType.ToString())
Next
Console.WriteLine()
Console.WriteLine("Methods")
Console.WriteLine("-------")
For Each fi As Reflection.MethodInfo In tp.GetMethods()
Console.WriteLine(Space(4) & fi.Name)
Next