Ejemplo n.º 1
0
 private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (checkedListBox1.SelectedIndex < 0)
     {
         labelEventName.Text     = "-";
         dateTimePicker1.Enabled = false;
         dateTimePicker2.Enabled = false;
         textBox1.Enabled        = false;
         textBox2.Enabled        = false;
         textBox3.Enabled        = false;
         buttonSave.Enabled      = false;
     }
     else
     {
         CalendarEntry ce = checkedListBox1.Items[checkedListBox1.SelectedIndex] as CalendarEntry;
         dateTimePicker1.Enabled = true;
         dateTimePicker1.Value   = ce.StartTime;
         dateTimePicker2.Enabled = true;
         dateTimePicker2.Value   = ce.EndTime;
         textBox1.Enabled        = true;
         textBox1.Text           = ce.Location;
         textBox2.Enabled        = true;
         textBox2.Text           = ce.Summary;
         textBox3.Enabled        = true;
         textBox3.Text           = ce.Description;
         buttonSave.Enabled      = true;
         labelEventName.Text     = ce.ToString();;
     }
 }