private void BuyButton_Click(object sender, EventArgs e) { var selectedItem = GetSelectedItem(); if (InventoryController.CanBuyItem(selectedItem)) { SellingItemsPanel.Controls.Remove(_selectedPictureBox); InventoryController.BuyItem(selectedItem); InventoryController.Update(); } }