OnWindowlessKeyDown() protected méthode

protected OnWindowlessKeyDown ( Control sender, KeyEventArgs e ) : void
sender System.Windows.Forms.Control
e System.Windows.Forms.KeyEventArgs
Résultat void
Exemple #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            WindowlessControlHost host = this;

            while (host != null)
            {
                host.OnWindowlessKeyDown(this, e);
                host = host.Parent as WindowlessControlHost;
            }
            OnWindowlessUnhandledKeyDown(this, e);
            base.OnKeyDown(e);
        }
Exemple #2
0
        static void Control_KeyDown(object sender, KeyEventArgs e)
        {
            Control control = FindFocusedControl(sender as Control);

            if (control is WindowlessControlHost)
            {
                return;
            }

            Control parent = control;

            while (parent != null)
            {
                WindowlessControlHost parentHost = parent as WindowlessControlHost;
                if (parentHost != null)
                {
                    parentHost.OnWindowlessKeyDown(control, e);
                }
                parent = parent.Parent;
            }
            OnWindowlessUnhandledKeyDown(control, e);
        }