示例#1
0
 private void newB_Click(object sender, EventArgs e)
 {
     newStitDialog dialog = new newStitDialog();
     this.Hide();
     if (dialog.ShowDialog(this) == DialogResult.OK)
     {
         listBox.Items.Add(dialog.jmeno);
     }
     this.Show();
 }
示例#2
0
        private void editB_Click(object sender, EventArgs e)
        {
            if (Program.getDB().stity.FindByjmeno(listBox.Text) == null)
            {
                MessageBox.Show("Pro úpravu musíte vybrat štít ze seznamu.", "Vyberte štít", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            newStitDialog dialog = new newStitDialog(listBox.Text);
            this.Hide();

            if (dialog.ShowDialog(this) == DialogResult.OK)
            {
                listBox.Items.Insert(listBox.Items.IndexOf(dialog.edit), dialog.jmeno);
                listBox.Items.RemoveAt(listBox.Items.IndexOf(dialog.edit));
            }
            this.Show();
        }