Dictionary<string, string> rdic = new Dictionary<string, string>();
rdic = JsonNewtonsoft.FromJSON<Dictionary<string, string>>(rconfig);
var dic = new Dictionary<string, bool>();
dic.Add("1",true);
dic.Add("0",false);
dic.Add("",false);
foreach (KeyValuePair<string, string> kvp in rdic)
{
Control col = this.Controls.Find(kvp.Key, true)[0];
if (col is RadioButton)
{
((RadioButton) col).Checked = dic[kvp.Value];
}
if (col is CheckBox)
{
((RadioButton) col).Checked = dic[kvp.Value];
}
}
WinForm中将字符串转化为控件名称
最新推荐文章于 2023-11-11 08:49:58 发布