ComponentFactory.Krypton.Toolkit.ViewManager.KeyPress C# (CSharp) Method

KeyPress() public method

Perform key press handling.
public KeyPress ( KeyPressEventArgs e ) : void
e System.Windows.Forms.KeyPressEventArgs A KeyPressEventArgs that contains the event data.
return void
        public virtual void KeyPress(KeyPressEventArgs e)
        {
            // Tell current view of key event
            if (ActiveView != null)
                ActiveView.KeyPress(e);
            else if (_root != null)
                _root.KeyPress(e);
        }

Usage Example

Beispiel #1
0
        /// <summary>
        /// Raises the KeyPress event.
        /// </summary>
        /// <param name="e">A KeyPressEventArgs that contains the event data.</param>
        protected override void OnKeyPress(KeyPressEventArgs e)
        {
            // Cannot process a message for a disposed control
            if (!IsDisposed)
            {
                // Do we have a manager for processing key messages?
                ViewManager?.KeyPress(e);
            }

            // Let base class fire events
            base.OnKeyPress(e);
        }