Exemple #1
0
 private void DTPTo_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         BtnViewReport.Focus();
     }
 }
Exemple #2
0
 private void DTPTo_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         if (e.KeyCode == Keys.Enter)
         {
             BtnViewReport.Focus();
         }
     }
     catch (Exception excp)
     {
     }
 }
        private void cmbstatus_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                e.SuppressKeyPress = true; // This will eliminate the beeping
                bool inList = false;
                for (int i = 0; i < cmbstatus.Items.Count; i++)
                {
                    s = cmbstatus.GetItemText(cmbstatus.Items[i]);
                    if (s == cmbstatus.Text)
                    {
                        inList         = true;
                        cmbstatus.Text = s;
                        break;
                    }
                }
                if (!inList)
                {
                    cmbstatus.Text = "";
                }

                BtnViewReport.Focus();
            }
        }