private void EditSelectedShow() { if (listViewItems.SelectedItems.Count == 1) { ListViewItem lvItem = listViewItems.SelectedItems[0]; ScheduleItem scheduleItem = lvItem.Tag as ScheduleItem; Shows.Show show = scheduleItem.Show; if (show != null) { using (Shows.ShowEditorForm f = new Shows.ShowEditorForm(show)) { if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UpdateListItem(scheduleItem); } } } else { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("The selected schedule does not have a show associated with it.", "Edit a Show", false, true); messageBox.ShowDialog(); } } }
private void EditSelectedShow() { if (listViewItems.SelectedItems.Count == 1) { ListViewItem lvItem = listViewItems.SelectedItems[0]; ScheduleItem scheduleItem = lvItem.Tag as ScheduleItem; Shows.Show show = scheduleItem.Show; if (show != null) { using (Shows.ShowEditorForm f = new Shows.ShowEditorForm(show)) { if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { UpdateListItem(scheduleItem); } } } else { MessageBox.Show("The selected schedule does not have a show associated with it.", "Edit a Show", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } } }