/// <summary> /// Enables the object to process keyboard accelerators. /// </summary> public int TranslateAcceleratorIO(ref NativeMethods.MSG msg) { if ((msg.message == 256) && ((msg.wParam == 9) || (msg.wParam == 117))) { if (base.SelectNextControl( base.ActiveControl, Control.ModifierKeys != Keys.Shift, true, true, false)) { return(0); } } return(1); }
/// <summary> /// UI-activates or deactivates the object. /// </summary> /// <param name="fActivate"> /// Indicates if the object is being activated or deactivated. If this value is /// nonzero, the object is being activated. If this value is zero, the object is /// being deactivated. /// </param> public void UIActivateIO(int fActivate, ref NativeMethods.MSG msg) { if (fActivate != 0) { Control nextControl = base.GetNextControl(this, true); if (Control.ModifierKeys == Keys.Shift) { nextControl = base.GetNextControl(nextControl, false); } if (nextControl != null) { nextControl.Select(); } base.Focus(); } }