📌  相关文章
📜  按名称在窗体上设置控件的属性 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:59.257000             🧑  作者: Mango

代码示例1
var controlName = 'yourcontrolName from db';
var propertyName = 'your property name from db';
object value = //the deserialized value from db;

var control = findControlByName(controlName);
control.GetType().GetProperty(propertyName, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance).SetValue(control, value, new object[] { });