S
Steve
Hiya
I have a nodeReader object that I am looping through in order to retrieve
the values from the attributes, but now I need the attribute name as well,
does anyone know how to do this? I will post the code I have below:
--------------------------
'// Element example: <TextBox parent='Form' Name='txtTitle' Top='56'
Width='100' Left='152' Text='Title' />
Dim pi As System.Reflection.PropertyInfo
Dim t1 As Type = myTextBox.GetType
For i = 1 to nodeReader.AttributeCount
pi = t1.GetProperty(**Need to get the Attribute value here. Eg: Name**)
pi.SetValue(myTextBox, nodeReader.GetAttribute(i).ToString, Nothing)
Next
-------------------------
I'm sure you can see from the example, I am trying to loop through all the
attributes in my element in an XML file and set the properties of the
TextBox. I would prefer to do it this way so all I need to do in the future
is add in an appropriate attribute and value and my program will pick it up
automatically. The GetAttribute gets my value but I just need a way to get
the name of the attribute.
Thanks
Kind Regards,
Steve.
I have a nodeReader object that I am looping through in order to retrieve
the values from the attributes, but now I need the attribute name as well,
does anyone know how to do this? I will post the code I have below:
--------------------------
'// Element example: <TextBox parent='Form' Name='txtTitle' Top='56'
Width='100' Left='152' Text='Title' />
Dim pi As System.Reflection.PropertyInfo
Dim t1 As Type = myTextBox.GetType
For i = 1 to nodeReader.AttributeCount
pi = t1.GetProperty(**Need to get the Attribute value here. Eg: Name**)
pi.SetValue(myTextBox, nodeReader.GetAttribute(i).ToString, Nothing)
Next
-------------------------
I'm sure you can see from the example, I am trying to loop through all the
attributes in my element in an XML file and set the properties of the
TextBox. I would prefer to do it this way so all I need to do in the future
is add in an appropriate attribute and value and my program will pick it up
automatically. The GetAttribute gets my value but I just need a way to get
the name of the attribute.
Thanks
Kind Regards,
Steve.