the big problem was to create a control with specified properties in format of string and add them to a form. that really was on my nurves for 2 weeks.
I'm going to put the most important part here.
I hope this be useful for you.
PropertyInfo pi = control.GetType().GetProperty("Cursor");
TypeConverter convertor = TypeDescriptor.GetConverter(pi.PropertyType);
object arg = convertor.ConvertFromString("Hand");
control.GetType().InvokeMember("Cursor", BindingFlags.SetProperty, null, control, new object[] {arg});
"Cursor" is property of control which is instantiated from assembly in runtime.
as you can see everything is made and set by string.
No comments:
Post a Comment