private void editB_Click(object sender, EventArgs e) { if (Program.getDB().zbroje.FindByjmeno(list1.Text) == null) { MessageBox.Show("Pro úpravu musíte vybrat zbroj ze seznamu.", "Vyberte zbroj", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } newZbrojDialog editras = new newZbrojDialog(list1.Text, 0); editras.Text = "Úprava zbroje"; this.Hide(); if (editras.ShowDialog(this) == DialogResult.OK) { list1.Items.Insert(list1.Items.IndexOf(editras.edit), editras.jmeno); list1.Items.RemoveAt(list1.Items.IndexOf(editras.edit)); } this.Show(); }
private void newB_Click(object sender, EventArgs e) { newZbrojDialog newras = new newZbrojDialog(0); newras.Text = "Nová zbroj"; this.Hide(); if (newras.ShowDialog(this) == DialogResult.OK) { list1.Items.Add(newras.jmeno); } newras.Close(); this.Show(); }