Пример #1
0
 private void Year_KeyDown(object sender, KeyEventArgs e)
 {
     try
     {
         //this.Parent.Parent.Parent.Parent.GetNextControl(this, true).Focus();
         //if (e.KeyCode == Keys.Enter)
         //    SendKeys.Send("{TAB}");
         if (e.KeyCode == Keys.Enter)
         {
             if (NextControl != null && NextControl.Visible && NextControl.Enabled)
             {
                 NextControl.Focus();
             }
             else if (NextControl != null && (!NextControl.Visible | !NextControl.Enabled))
             {
                 SendKeys.Send("{TAB}");
             }
         }
         else
         {
             CheckKeyUpDown(e, Year, 2200);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         if (NextControl != null)
         {
             NextControl.Focus();
         }
         base.OnKeyDown(e);
     }
 }
Пример #3
0
 void Atiran2DateControl_Enter(object sender, EventArgs e)
 {
     if (_dateCriterionFromServer)
     {
         if (NextControl != null && NextControl.Visible && NextControl.Enabled)
         {
             NextControl.Focus();
         }
         else if (NextControl != null && (!NextControl.Visible | !NextControl.Enabled))
         {
             SendKeys.Send("{TAB}");
         }
         this.Enabled = false;
     }
     else
     {
         Day.Focus();
     }
 }