private void shapeDuplicateBT_Click(object sender, EventArgs e) { if (listBox1.SelectedItems.Count > 0) { string areaText = ""; List <Area> selectedAreas = new List <Area>(); foreach (object areaObj in listBox1.SelectedItems) { Area area = areaObj as Area; if (!area.IsSubComponent) { AreaMapComponent.Duplicate(area); } } RefreshListBox(); } }