public void UpdateItems() { ItemsPanel.Controls.Clear(); ItemsPanel.RowCount = Hero.Items.Count; foreach (var item in Hero.Items) { var loabel = new Label { Margin = new Padding(0, 0, 0, 2), Size = new Size(128, 24), BackColor = Color.Black, ForeColor = Colors.ItemTierColors[item.Tier], Text = item.Name, Font = new Font(FontFamily.GenericSansSerif, 12), TextAlign = ContentAlignment.MiddleCenter, }; loabel.Click += (sender, args) => { ParentForm.OpenShop(item); }; loabel.DoubleClick += (sender, args) => { var dialogResult = MessageBox.Show( "Are you sure you want to throw away a " + item.Name + "?", "Delete item?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation ); if (dialogResult == DialogResult.Yes) { item.Remove(Hero); ParentForm.ControlPanelUpdate(); ParentForm.StatPanelUpdate(); UpdateItems(); } }; ItemsPanel.Controls.Add(loabel); } }