Esempio n. 1
0
 public static extern IntPtr DeferWindowPos(IntPtr hDefer, IntPtr hWnd, IntPtr hWndInsertAfter,
                                            int left, int top, int width, int height, MoveWindowFlags flags);
Esempio n. 2
0
 public static extern void SetWindowPos(IntPtr hWnd, IntPtr hWndNewParent, int left, int top, int width, int height, MoveWindowFlags flags);
Esempio n. 3
0
 public void AddControl(Control windowToMove, Control windowToInsertZOrderAfter, Rect frame, MoveWindowFlags flags = 0)
 {
     Handle = NativeMethods.DeferWindowPos(Handle, windowToMove.Handle, windowToInsertZOrderAfter.Handle,
                                           frame.left, frame.top, frame.Width, frame.Height, flags);
 }
Esempio n. 4
0
        public void AddControl(Control windowToMove, ZOrderPosition specialZOrderPosition, Rect frame, MoveWindowFlags flags = 0)
        {
            IntPtr hWndSpecial;

            switch (specialZOrderPosition)
            {
            case ZOrderPosition.Top: hWndSpecial = HWND_TOP; break;

            case ZOrderPosition.Bottom: hWndSpecial = HWND_BOTTOM; break;

            case ZOrderPosition.Topmost: hWndSpecial = HWND_TOPMOST; break;

            case ZOrderPosition.AboveNonTopmost: hWndSpecial = HWND_NOTOPMOST; break;

            default: throw new ArgumentException("Invalid ZOrderPosition value", nameof(specialZOrderPosition));
            }

            Handle = NativeMethods.DeferWindowPos(Handle, windowToMove.Handle, hWndSpecial,
                                                  frame.left, frame.top, frame.Width, frame.Height, flags);
        }
Esempio n. 5
0
 public void AddControl(Control windowToMove, Rect frame, MoveWindowFlags flags = 0)
 {
     Handle = NativeMethods.DeferWindowPos(Handle, windowToMove.Handle, IntPtr.Zero,
                                           frame.left, frame.top, frame.Width, frame.Height, flags | MoveWindowFlags.IgnoreZOrder);
 }