IsMnemonic() public static method

public static IsMnemonic ( char charCode, string text ) : bool
charCode char
text string
return bool
Example #1
0
        protected internal override bool ProcessMnemonic(char charCode)
        {
            if ((!this.UseMnemonic || !Control.IsMnemonic(charCode, this.Text)) || !this.CanProcessMnemonic())
            {
                return(false);
            }
            Control parentInternal = this.ParentInternal;

            if (parentInternal != null)
            {
                System.Windows.Forms.IntSecurity.ModifyFocus.Assert();
                try
                {
                    if (parentInternal.SelectNextControl(this, true, false, true, false) && !parentInternal.ContainsFocus)
                    {
                        parentInternal.Focus();
                    }
                }
                finally
                {
                    CodeAccessPermission.RevertAssert();
                }
            }
            return(true);
        }
 protected internal override bool ProcessMnemonic(char charCode)
 {
     if ((base.UseMnemonic && this.CanProcessMnemonic()) && Control.IsMnemonic(charCode, this.Text))
     {
         this.PerformClick();
         return(true);
     }
     return(base.ProcessMnemonic(charCode));
 }
Example #3
0
 protected internal override bool ProcessMnemonic(char charCode)
 {
     if ((!base.UseMnemonic || !Control.IsMnemonic(charCode, this.Text)) || !base.CanSelect)
     {
         return(false);
     }
     if (!this.Focused)
     {
         this.FocusInternal();
     }
     else
     {
         this.PerformClick();
     }
     return(true);
 }
 protected internal override bool ProcessMnemonic(char charCode)
 {
     if ((!base.UseMnemonic || !Control.IsMnemonic(charCode, this.Text)) || !base.CanSelect)
     {
         return(false);
     }
     if (this.FocusInternal())
     {
         base.ResetFlagsandPaint();
         if (!base.ValidationCancelled)
         {
             this.OnClick(EventArgs.Empty);
         }
     }
     return(true);
 }
 protected internal override bool ProcessMnemonic(char charCode)
 {
     if (!Control.IsMnemonic(charCode, this.Text) || !this.CanProcessMnemonic())
     {
         return(false);
     }
     System.Windows.Forms.IntSecurity.ModifyFocus.Assert();
     try
     {
         base.SelectNextControl(null, true, true, true, false);
     }
     finally
     {
         CodeAccessPermission.RevertAssert();
     }
     return(true);
 }