سؤال

In his book (Pro WPF in C# 2010 Windows Presentation Foundation in .NET 4) Matthew MacDonald - writes:

...you can use DwmEnableBlurBehindWindow() to apply the glass effect to a specific region in a window.

Does this mean I can apply a aero glass effect to a specific controls (or at least an area they occupy)?

Please provide an example on how to do it with C#.

هل كانت مفيدة؟

المحلول

If I understand your intent is to apply DWM implemented blur to a control that would show the content in the window behind it, then no: "This function can only be called on top-level windows.".

You could, however, apply DWM blur to the toplevel window containing the control in the control's area, and see the windows behind it. Check out the P/Invoke signatures for DwmEnableBlurBehindWindow, CreateRectRgn and DeleteObject to clean up the blur region.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top