private void AddItem_Click(object sender, EventArgs e) { this.AdminSplitContainer.Panel2.Controls.Clear(); var itemUserControl = new ItemUserControl(); this.AdminSplitContainer.Panel2.Controls.Add(itemUserControl); }
public void PopulateInventory(Item[] items) { GrdInventory.Children.Clear(); GrdInventory.RowDefinitions.Clear(); int s = 0; for (int i = 0; i < items.Length; i++) { Item item = items[i]; if (item.ItemQuantity <= 0) { continue; } ItemUserControl itemUserControl = new ItemUserControl(item, this); RowDefinition rowDefinition = new RowDefinition(); rowDefinition.Height = new GridLength(50, GridUnitType.Pixel); GrdInventory.RowDefinitions.Add(rowDefinition); GrdInventory.Children.Add(itemUserControl); Grid.SetRow(itemUserControl, s); s++; } }
private void viewItemToolStripMenuItem_Click(object sender, EventArgs e) { ItemUserControl item = new ItemUserControl(); AddControlsToPanel(item); }