コード例 #1
0
        private void btnCreateEvent_Click(object sender, EventArgs e)
        {
            Event         _event        = null;
            EditEventForm editEventForm = new EditEventForm();

            if (editEventForm.ShowDialog() == DialogResult.OK)
            {
                _event = editEventForm.GetEvent();
                listBoxEvents.Items.Add(_event);
            }
        }
コード例 #2
0
        private void btnEditEvent_Click(object sender, EventArgs e)
        {
            if (listBoxEvents.SelectedItem == null)
            {
                return;
            }
            Event         _event        = null;
            EditEventForm editEventForm = new EditEventForm();

            editEventForm.SetEvent((Event)listBoxEvents.SelectedItem);

            if (editEventForm.ShowDialog() == DialogResult.OK)
            {
                _event = editEventForm.GetEvent();
                listBoxEvents.Items[listBoxEvents.SelectedIndex] = _event;
            }
        }