Joe,
Actually, it looks like this will do the trick, to get the property, i.e., -
PropertyInfo aPropInfo = aFieldInfo.FieldType.GetProperty("DataBindings");
But now the paradox:
If I want to GetValue() or Invoke the Get method of the property, I need the
Object for the FieldInfo! (In my example, the TextBox object itself.)
How does one get the actual object of the type returned by GetField().
(This stuff is hard to explain!)
Thanks,
- dave
[quoted text, click to view] "Jon Shemitz" wrote:
> darndt wrote:
>
> > Given a FieldInfo for a given instance variable, how can I then get
> > PropertyInfo for a member of that object (assuming a type)...
>
> Sounds like you want FieldInfo.DeclaringType - the Type the field is a
> member of.
>
> --
>
>
www.midnightbeach.com
Ah! I was looking at the return value in the debugger and it was showing me
the TextBox text value - so I though it was retrieving some default value
from the object, rather than the object itself!
A simple trace out of the object's type name revealed that it is indeed the
text box object.
OK!