public void SelectLabel(Label l) { (l.Tag as LabelTag).Selected = true; SelectedLabels.Add(l); l.BorderStyle = BorderStyle.FixedSingle; // Fire event "SelectedLabelsChanged" SelectedLabelsChanged(null, null); }
public void SelectAllLabels() { SelectedLabels.Clear(); // Performance boost Container.SuspendLayout(); if (Container.Controls.Count > 200) Container.Visible = false; foreach (Control c in Container.Controls) { (c.Tag as LabelTag).Selected = true; SelectedLabels.Add(c); (c as Label).BorderStyle = BorderStyle.FixedSingle; } Container.SuspendLayout(); Container.Visible = true; // Fire event "SelectedLabelsChanged" SelectedLabelsChanged(null, null); }