"Ted Neward" <[EMAIL PROTECTED]> wrote:

> field is not a TextBox--field is a FieldInfo instance,

That was my first thought until I read the original code carefully:

> >        object field = fieldInfo.GetValue(form);

So field is the field itself here, not the FieldInfo - that's in
fieldInfo...  So this is confusing - the type really should be TextBox.


So what I'm now wondering is this:

> >  case "System.Windows.Forms.TextBox":
> >   txtBox = (TextBox)field;

It couldn't be a namespace issue could it?  Which TextBox is in scope?
(There are two defined in the framework - one by Windows Forms, one by Web
Forms.)

The thing is that I just tried this and it worked fine...  So there must be
something about the context of your example - there's nothing wrong with the
code as it stands.

--
Ian Griffiths
DevelopMentor

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to