send0xx
send0xx

Reputation: 73

Borderless window with shadow and blurbehind

I tried SetWindowCompositionAttribute solution, and it worked well, but no shadows.
I tried combine blurbehind + apply shadow on window with DropShadow for WPF Borderless Window but here i got issue with unfocus/focus window lost transparancy.
Is it possible to make borderless window with blurbehind + shadow (and some close/min/max)?
Example: AMD Radeon Settings. Is it wpf? Or custom c++ solution.

Upvotes: 1

Views: 1618

Answers (2)

Goose Bomb
Goose Bomb

Reputation: 46

var accent = new AccentPolicy()
{
  AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND,
  AccentFlags = 0x20 | 0x40 | 0x80 | 0x100,
};

the set Value of AccentFlags will give your window a dropshadow effect like menu and calendar of Windows 10 does enter image description here

enter image description here

Upvotes: 3

JohnChris
JohnChris

Reputation: 1360

I know how to do this in XAML, it's probably best to have all visual code in XAMl and logical code in C#.

Code:

//Set BorderThickness to 0 for no boreder //play with DropDownShadowEffect

 <Border BorderBrush="color" BorderThickness="0" >
      <Border.Effect>
         <DropShadowEffect BlurRadius="10" Color="black" Direction="235" Opacity=".3" RenderingBias="Performance"  ShadowDepth="4" />
      </Border.Effect>
 </Border>

hope that is what you are looking for

Upvotes: 0

Related Questions