/// <summary>
        ///     Sets the size.
        /// </summary>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        public void SetSize(int width, int height)
        {
            Width  = width;
            Height = height;

            Native.SetWindowPos(Handle, WindowConstants.HwndTopmost, X, Y, Width, Height, 0);

            Graphics.AutoResize(Width, Height);

            ExtendFrameIntoClient();
        }
예제 #2
0
        /// <summary>
        ///     Sets the size.
        /// </summary>
        /// <param name="width">The width.</param>
        /// <param name="height">The height.</param>
        public void SetSize(int width, int height)
        {
            Width  = width;
            Height = height;

            Native.Point pos;
            pos.X = X;
            pos.Y = Y;

            Native.Point size;
            size.X = Width;
            size.Y = Height;

            Native.UpdateLayeredWindow(Handle, IntPtr.Zero, ref pos, ref size, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero,
                                       0);

            Graphics.AutoResize(Width, Height);

            ExtendFrameIntoClient();
        }