private void button1_Click(object sender, EventArgs e) { D1TextBoxProperty per = (this.propertyGrid1.SelectedObject as D1TextBoxProperty); m_return = per; Console.WriteLine(per.Name + per.LabelName); Close(); }
private void FrmPropertyDesign_Load(object sender, EventArgs e) { Console.WriteLine(m_control.GetType()); D1TextBoxProperty per = new D1TextBoxProperty() { Name = m_control.Name, LabelName = (m_control as D1Lib.D1TextBox).LabelName }; this.propertyGrid1.SelectedObject = per; }
private void Fields_Edit_Click(object sender, EventArgs e) { Control ctl = this.propertyGrid1.SelectedObjects[0] as Control; FrmPropertyDesign frmPropertyDesign = new FrmPropertyDesign(); frmPropertyDesign.m_control = ctl; frmPropertyDesign.ShowDialog(); D1TextBoxProperty pro = (frmPropertyDesign.m_return as D1TextBoxProperty); if (pro == null) { return; } if (ctl.Name != pro.Name && ControlMap.ContainsKey(pro.Name)) { MessageBox.Show("字段名重复,请检查!"); return; } Console.WriteLine(pro.Name + pro.LabelName); this.propertyGrid1.Refresh(); }