private void AddItem_Click(object sender, EventArgs e) { AddItem addNewItem = new AddItem(); DialogResult result = addNewItem.ShowDialog(); if (result == DialogResult.OK) { GetItemInfo(); itemsListBox.SelectedItem = addNewItem.itemName; } else if (result == DialogResult.Cancel) { GetItemInfo(); } }
private void BtnAddItem_Click(object sender, EventArgs e) { AddItem addNewItem = new AddItem(); DialogResult result = addNewItem.ShowDialog(); if (result == DialogResult.OK) { GetItemList(); cmboBodyDoors.Text = addNewItem.itemName; } else if (result == DialogResult.Cancel) { GetItemList(); cmboBodyDoors.SelectedIndex = -1; } }