public void RemoveAttribute(XmlAttributeRow row) { if (listPanel.Controls.Count > 1) { listPanel.Controls.Remove(row); } }
void listPanelControlChanged(object sender, ControlEventArgs e) { int index = 1; XmlAttributeRow lastRow = null; _attributes.Clear(); foreach (Control control in listPanel.Controls) { if (control is XmlAttributeRow) { lastRow = (XmlAttributeRow)control; lastRow.IsAddButtonVisible = false; lastRow.IsRemoveButtonVisible = true; lastRow.Number = index++; } } if (lastRow != null) { lastRow.IsAddButtonVisible = true; if (listPanel.Controls.Count == 1) { lastRow.IsRemoveButtonVisible = false; } } listPanel.Height = listPanel.PreferredSize.Height; this.Height = this.PreferredSize.Height; }
public void RemoveAttribute(XmlAttributeRow row) { if (listPanel.Controls.Count > 1) { listPanel.Controls.Remove(row); } }