The relationship between your two blocks of code is a little hazy, so...
You could use reflection:
ObjectType.GetProperty("Title").SetValue(myObj, TitleTbox.Text, null);
Alternatively, if you are talking about windows-forms, then you might be
able to usee bindings to attach the "Text" property of the textbox to the
"Title" property of the object, and it will manage reads and writes for you.
Otherwise - do you have multiple objects with a .Title (and the other
properties)? If so, then interfaces are the way to go - if myObj is always
going to be one of these.
Marc
|