private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { int i = 0; foreach (Control ctrl in Controls) { if (ctrl.GetType() == typeof(FieldDoc)) { Controls.RemoveAt(i); } i++; } fld = tbl.GetField(comboBox1.SelectedIndex); FieldDoc fldDoc = new FieldDoc(fld, this, selectedIndex); fldDoc.Location = new Point(15, 169); this.Controls.Add(fldDoc); }
public void SaveChangesField() { //Field tbl = (Table)treeView1.SelectedNode.Tag; List <string> comments = new List <string>(); FieldDoc fldDoc = new FieldDoc(fld, this, selectedIndex); foreach (Control ctrl in Controls) { if (ctrl.GetType() == typeof(FieldDoc)) { fldDoc = (FieldDoc)ctrl; } } List <string> commentsForm = fldDoc.GetComments(); foreach (string comment in commentsForm) { comments.Add(comment); } fld.addComments(comments); }