示例#1
0
        private void button4_Click(object sender, EventArgs e)
        {
            ToyEditForm toyEdit = new ToyEditForm(allToys[listBox1.SelectedIndex]);

            toyEdit.ShowDialog();
            RefreshData();
        }
示例#2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Toy         toy     = new Toy();
            ToyEditForm toyEdit = new ToyEditForm(toy);

            toyEdit.ShowDialog();
            if (toyEdit.DialogResult == DialogResult.OK)
            {
                allToys.Add(toy);
                listBox1.Items.Add(toy);
            }
        }