Example #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            var fp = new FormPerson();

            fp.Person = new Person();
            if (fp.ShowDialog() == DialogResult.OK)
            {
                phoneBook.Add(fp.Person);
            }
        }
Example #2
0
        private void listBoxPeople_DoubleClick(object sender, EventArgs e)
        {
            if (listBoxPeople.SelectedItem == null)
            {
                return;
            }
            var fp = new FormPerson();

            fp.Person = listBoxPeople.SelectedItem as Person;

            fp.ShowDialog();
        }