I am needing to make a custom window with WindowStyle.None, AllowsTransparency = true, etc.
One requirement is a custom ResizeGrip control.
I have this working with ResizeMode.CanResizeWithGrip, taking some code from an open source project found here: Fluid Kit
See the "GlassWindow" class if you're interested.
To do the work, I'm calling the following code on the MouseLeftButtonDown event of the ResizeGrip:
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 is all working, but I notice some strangeness when you resize via a SouthWest (or any left or top) side. You are able to see the WPF window redraw for both a size and position change (which always occurs when resizing from the top or left).
If you try this on any window with the default window style and resize mode, it works just fine. With the exception of XP, you have to have the classic theme on.
Does anyone know an alternative to using this? Or a way to fix it?
I also posted some information on MSDN forums, here: MSDN Forums
PS - You can see this behavior first hand if someone wants to svn checkout Fluid Kit and run the GlassWindow example by setting StartupUri="GlassWindow/Window1.xaml" in their example project.
EDIT: Microsoft told me to send a product suggestion...
The link is here if anyone has a similar problem:
I also put an example here if you would like to try it first hand: