예제 #1
0
        protected override bool ProcessMnemonic(char charCode)
        {
            if (FocusControl == null)
            {
                return(base.ProcessMnemonic(charCode));
            }

            if ((!this.UseMnemonic || !Control.IsMnemonic(charCode, this.Text) ||
                 !FocusControl.CanFocus)
                /*|| !this.CanProcessMnemonic()*/) // some day check this also? but have to use reflection to do so!
            {
                return(false);
            }

            _ModifyFocus.Assert();
            try
            {
                FocusControl.Focus();
            }
            finally
            {
                CodeAccessPermission.RevertAssert();
            }

            return(true);
        }
        private void FrmTaskDialogShown(object sender, EventArgs e)
        {
            switch (TaskConfig.MainIcon)
            {
            case CommonIcon.Error:
                System.Media.SystemSounds.Hand.Play();
                break;

            case CommonIcon.Information:
                System.Media.SystemSounds.Asterisk.Play();
                break;

            case CommonIcon.Warning:
                System.Media.SystemSounds.Exclamation.Play();
                break;
            }

            if (FocusControl != null)
            {
                FocusControl.Focus();
            }

            if (null != Created)
            {
                Created(this, e);
            }
        }
 private void Compilar_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     FocusControl.Focus();
 }
 private void Storyboard_Completed(object sender, EventArgs e)
 {
     FocusControl?.Focus();
 }