C # WPF - custom resizing

I need to create my own window with WindowStyle.None, AllowsTransparency = true, etc.

One of the requirements is a customizable ResizeGrip control.

I have a job with ResizeMode.CanResizeWithGrip, taking some code from an open source project found here: Fluid Kit

If you're interested, check out the "GlassWindow" class.

To do this, I call the following code in the MouseLeftButtonDown ResizeGrip event:

NativeMethods.SendMessage(_interopHelper.Handle, WM.SYSCOMMAND, (IntPtr)((int)SC.SIZE + (int)sizingAction), IntPtr.Zero);

SizingAction is defined as:

    enum SizingAction
    {
        West = 1,
        East = 2,
        North = 3,
        NorthWest = 4,
        NorthEast = 5,
        South = 6,
        SouthWest = 7,
        SouthEast = 8,
    }

It all works, but I notice weirdness when you resize using the SouthWest (or any left or top) side. You can see the redrawing of the WPF window for resizing and positioning (which always happens when resizing from above or to the left).

, . XP, .

- ? ?

MSDN, : MSDN

PS. , - Fluid Kit GlassWindow, StartupUri = "GlassWindow/Window1.xaml" .

EDIT: Microsoft ...

, - :

, :

+3
1

Microsoft , WPF-.

, , .. WPF .

WindowStyle None, WPF , , .

, . , - .

, , Microsoft . , , .

+8

Source: https://habr.com/ru/post/1725771/


All Articles