Ejemplo n.º 1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            if (personsListView.SelectedIndices.Count == 0)
            {
                return;
            }
            Person         p        = pers[personsListView.SelectedIndices[0]];
            EditPersonForm editForm = new EditPersonForm(p);

            if (editForm.ShowDialog() == DialogResult.OK)
            {
                personsListView.Invalidate();
            }
        }
Ejemplo n.º 2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            Person         p        = new Person();
            EditPersonForm editForm = new EditPersonForm(p);

            if (editForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            pers.Add(p);

            personsListView.VirtualListSize = pers.Count;
            personsListView.Invalidate();
        }