OnWindowlessKeyPress() 보호된 메소드

protected OnWindowlessKeyPress ( Control sender, KeyPressEventArgs e ) : void
sender System.Windows.Forms.Control
e System.Windows.Forms.KeyPressEventArgs
리턴 void
예제 #1
0
        protected override void OnKeyPress(KeyPressEventArgs e)
        {
            WindowlessControlHost host = this;

            while (host != null)
            {
                host.OnWindowlessKeyPress(this, e);
                host = host.Parent as WindowlessControlHost;
            }
            base.OnKeyPress(e);
        }
예제 #2
0
        static void Control_KeyPress(object sender, KeyPressEventArgs e)
        {
            Control control = FindFocusedControl(sender as Control);

            if (control is WindowlessControlHost)
            {
                return;
            }

            Control parent = control;

            while (parent != null)
            {
                WindowlessControlHost host = parent as WindowlessControlHost;
                if (host != null)
                {
                    host.OnWindowlessKeyPress(control, e);
                }
                parent = parent.Parent;
            }
        }