private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     Lblcapacidad.Text          = dataGridView1.CurrentRow.Cells[2].Value.ToString();
     lblUnidad.Text             = dataGridView1.CurrentRow.Cells[3].Value.ToString();
     lblunidadseleccionada.Text = dataGridView1.CurrentRow.Cells[0].Value.ToString();
     DateTimePicker1.Focus();
 }
 private void DateTimePicker1_Validating(System.Object sender, System.ComponentModel.CancelEventArgs e)
 {
     if ((DateTimePicker2.Value.Date) > (DateTimePicker1.Value.Date))
     {
         MessageBox.Show("Invalid Selection", "Input Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         DateTimePicker1.Focus();
     }
 }
Exemplo n.º 3
0
 private void ResetRecord()
 {
     DateTimePicker1.Value = DateTime.Now;
     TextBox1.Clear();
     TextBox2.Clear();
     TextBox3.Clear();
     btnadd.Text = "Add";
     DateTimePicker1.Focus();
 }