|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reflection - GetValue in a Structurei have this structure.. Public Structure MyStructure a as boolean b as boolean c as boolean .... end structure Dim Infos() As FieldInfo Dim fi As FieldInfo mInfos = GetType(MyStructure).GetFields for each fi in Infos msgbox fi.name next I Would "VALUE" for this Field.. John wrote:
Show quoteHide quote > Hello, You must provide an 'instance' of your structure to the FieldInfo> > i have this structure.. > > Public Structure MyStructure > a as boolean > b as boolean > c as boolean > .... > end structure > > Dim Infos() As FieldInfo > Dim fi As FieldInfo > mInfos = GetType(MyStructure).GetFields > > for each fi in Infos > msgbox fi.name > next > > I Would "VALUE" for this Field.. class: Dim X As MyStructure '... > for each fi in Infos Dim Value As Object = fi.GetValue(X)MsgBox fi.Name & "=" & Value.ToString > next Regards,Branco. |
|||||||||||||||||||||||