コード例 #1
0
 private void btnNewEvent_Click(object sender, EventArgs e)
 {
     using (EventForm newEventName = new EventForm())
     {
         var result = newEventName.ShowDialog();
         if (result == DialogResult.OK)
         {
             cbxEventsList.Items.Add(newEventName.EventName);
         }
     }
 }
コード例 #2
0
 private void btnEditEvent_Click(object sender, EventArgs e)
 {
     using (EventForm editEventName = new EventForm(cbxEventsList.SelectedItem.ToString()))
     {
         int eventIndex = cbxEventsList.SelectedIndex;
         var result     = editEventName.ShowDialog();
         if (result == DialogResult.OK)
         {
             cbxEventsList.Items[eventIndex] = editEventName.EventName;
         }
     }
 }