That is an option that I have looked at. However, at that point why not just hard code them. Building all of the properties would take much longer than just hard coding this.
What about GetField() versus GetProperty()? It seems that GetField() has access to the variables, but I cannot retrieve anything from them through GetField(). Maybe that's not possible. I just figured that the variables are stored somewhere. Why can't I get to them like I can get to the controls on the form through Me.Controls. I think the easiest option may be to just move the local string variables out to the form as hidden fields. Then I can use the form's control collection, as the hidden textboxes will be in the collection where the variables are not contained in a collection that I can parse through. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Bob Provencher Sent: Thursday, April 19, 2007 2:37 PM To: [email protected] Subject: Re: [ADVANCED-DOTNET] Creating filling a textbox from a string... sort of The second option probably wouldn't work the way you want because you'd have to code the property names... Which is the same as coding the variable names. If you change the locals to be properties of an object, you can then use reflection to get the values you want off of the object through type.GetProperty, and then PropertyInfo.GetValue. -----Original Message----- From: Discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of brian zinn Sent: Thursday, April 19, 2007 3:08 PM To: [email protected] Subject: Re: [ADVANCED-DOTNET] Creating filling a textbox from a string... sort of I think what you're asking is impossible - sounds like reflection on variable names. Just use a Dictionary<string, string>, make your array 2 dimensional or pass in an object with properties like FirstName... =================================== This list is hosted by DevelopMentorR http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
