private void newButton_Button_Pressed(object sender, EventArgs e) { RecordStatus_Form newForm = new RecordStatus_Form(); if (newForm.ShowDialog() == DialogResult.OK) { if (newForm.Status.Length > 0) { listView1.Items.Add(new ListViewItem(newForm.Status)); } } }
private void editButton_Button_Pressed(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { RecordStatus_Form newForm = new RecordStatus_Form(listView1.SelectedItems[0].Text); if (newForm.ShowDialog() == DialogResult.OK) { if (newForm.Status.Length > 0) { listView1.SelectedItems[0].Text = newForm.Status; } else { listView1.Items.Remove(listView1.SelectedItems[0]); } } } }