Exemplo n.º 1
0
        internal void TestDrop(IDockDragSource dragSource, DockOutlineBase dockOutline)
        {
            if (VisibleNestedPanes.Count == 1)
            {
                DockPane pane = VisibleNestedPanes[0];
                if (!dragSource.CanDockTo(pane))
                {
                    return;
                }

                Point ptMouse = Control.MousePosition;
                uint  lParam  = Win32Helper.MakeLong(ptMouse.X, ptMouse.Y);
                if (NativeMethods.SendMessage(Handle, (int)Msgs.WM_NCHITTEST, 0, lParam) == (uint)HitTest.HTCAPTION)
                {
                    dockOutline.Show(VisibleNestedPanes[0], -1);
                }
            }
        }
Exemplo n.º 2
0
        public static DockPane PaneAtPoint(Point pt, DockPanel dockPanel)
        {
            for (Control control = Win32Helper.ControlAtPoint(pt); control != null; control = control.Parent)
            {
                IDockContent content = control as IDockContent;
                if (content != null && content.DockHandler.DockPanel == dockPanel)
                {
                    return(content.DockHandler.Pane);
                }

                DockPane pane = control as DockPane;
                if (pane != null && pane.DockPanel == dockPanel)
                {
                    return(pane);
                }
            }

            return(null);
        }