ComponentFactory.Krypton.Navigator.KryptonPage.WndProc C# (CSharp) Метод

WndProc() защищенный Метод

Process Windows-based messages.
protected WndProc ( Message &m ) : void
m System.Windows.Forms.Message A Windows-based message.
Результат void
        protected override void WndProc(ref Message m)
        {
            // We need to snoop the need to show a context menu
            if (m.Msg == PI.WM_CONTEXTMENU)
            {
                // Only interested in overriding the behavior when we have a krypton context menu...
                if (KryptonContextMenu != null)
                {
                    // Extract the screen mouse position (if might not actually be provided)
                    Point mousePt = new Point(PI.LOWORD(m.LParam), PI.HIWORD(m.LParam));

                    // If keyboard activated, the menu position is centered
                    if (((int)((long)m.LParam)) == -1)
                        mousePt = new Point(Width / 2, Height / 2);
                    else
                        mousePt = PointToClient(mousePt);

                    // If the mouse posiiton is within our client area
                    if (ClientRectangle.Contains(mousePt))
                    {
                        if (!DesignMode)
                        {
                            // Show the context menu
                            KryptonContextMenu.Show(this, PointToScreen(mousePt));

                            // We eat the message!
                            return;
                        }
                    }
                }
            }

            base.WndProc(ref m);
        }