void ComboBox_SelectIndexChanged(object sender, EventArgs e) { ComboBox cmb = sender as ComboBox; Control linkage = ControllsReflect.GetElement((string)cmb.Tag, this.Controls); if (linkage == null) { return; } ComboBox linkEle = linkage as ComboBox; string pid = cmb.GetComboBoxSelectItemId(); QueryCommboxDataSource(linkEle, pid); }
private void CheckBox_Check(object sender, EventArgs e) { CheckBox ck = sender as CheckBox; string targetName = ck.Tag as string;//这是作用的目标元素 if (string.IsNullOrEmpty(targetName)) { return; } Control ele = ControllsReflect.GetElement(targetName, this.Controls); if (ck.Checked) { ele.Visible = true; } else { ele.Visible = false; } }