Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:06:20+00:00 2026-06-13T08:06:20+00:00

I have a borderless, non-resizable WPF form (WindowStyle=None, AllowsTransparency=True, ResizeMode=NoResize) with a semi-transparent background.

  • 0

I have a borderless, non-resizable WPF form (WindowStyle=None, AllowsTransparency=True, ResizeMode=NoResize) with a semi-transparent background. Here’s a picture of how the form, a semi-transparent red rectangle, looks right now, running on top of Notepad:

the form as it currently appears on top of Notepad

However, I’d like the background to be blurred, like how Aero glass does it, except without all the fancy window borders and colored background with stripes – I’d like to handle that myself. Here’s a mockup of how I want it to look like:

the form as I want it to be - blur anything that's below it

How can I achieve this in the most efficient way possible?

WinForms or WPF is fine by me. Hopefully it should use the same thing Aero glass uses (I’m fine with it working only with Aero enabled), instead of something crazy like capturing the screen region below as a bitmap and blurring that.

Here is a picture of what I DON’T want:

I don't want the entire Aero glass window chrome

I know this is possible and I know how to do it, but I DON’T want the entire Aero glass window chrome, or the borders and title bar, or the window to have the user-set Aero glass color, JUST the effect of blurring whatever is below the window/form.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:06:21+00:00Added an answer on June 13, 2026 at 8:06 am

    If you want to use the Aero blur then you can use the DwmEnableBlurBehindWindow api. Here’s an example derived Window that utilizes this.

    public class BlurWindow : Window
    {
        #region Constants
    
        private const int WM_DWMCOMPOSITIONCHANGED = 0x031E;
        private const int DWM_BB_ENABLE = 0x1; 
    
        #endregion //Constants
    
        #region Structures
        [StructLayout( LayoutKind.Sequential )]
        private struct DWM_BLURBEHIND
        {
            public int dwFlags;
            public bool fEnable;
            public IntPtr hRgnBlur;
            public bool fTransitionOnMaximized;
        }
    
        [StructLayout( LayoutKind.Sequential )]
        private struct MARGINS
        {
            public int cxLeftWidth;
            public int cxRightWidth;
            public int cyTopHeight;
            public int cyBottomHeight;
        } 
        #endregion //Structures
    
        #region APIs
    
        [DllImport( "dwmapi.dll", PreserveSig = false )]
        private static extern void DwmEnableBlurBehindWindow(IntPtr hwnd, ref DWM_BLURBEHIND blurBehind);
    
        [DllImport( "dwmapi.dll" )]
        private static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMargins);
    
        [DllImport( "dwmapi.dll", PreserveSig = false )]
        private static extern bool DwmIsCompositionEnabled(); 
    
        #endregion //APIs
    
        #region Constructor
        public BlurWindow()
        {
            this.WindowStyle = System.Windows.WindowStyle.None;
            this.ResizeMode = System.Windows.ResizeMode.NoResize;
            this.Background = Brushes.Transparent;
        } 
        #endregion //Constructor
    
        #region Base class overrides
        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized( e );
    
            if ( Environment.OSVersion.Version.Major >= 6 )
            {
                var hwnd = new WindowInteropHelper( this ).Handle;
                var hs = HwndSource.FromHwnd( hwnd );
                hs.CompositionTarget.BackgroundColor = Colors.Transparent;
    
                hs.AddHook( new HwndSourceHook( this.WndProc ) );
                this.InitializeGlass( hwnd );
            }
        } 
        #endregion //Base class overrides
    
        #region Methods
    
        #region InitializeGlass
        private void InitializeGlass(IntPtr hwnd)
        {
            if ( !DwmIsCompositionEnabled() )
                return;
    
            // fill the background with glass
            var margins = new MARGINS();
            margins.cxLeftWidth = margins.cxRightWidth = margins.cyBottomHeight = margins.cyTopHeight = -1;
            DwmExtendFrameIntoClientArea( hwnd, ref margins );
    
            // initialize blur for the window
            DWM_BLURBEHIND bbh = new DWM_BLURBEHIND();
            bbh.fEnable = true;
            bbh.dwFlags = DWM_BB_ENABLE;
            DwmEnableBlurBehindWindow( hwnd, ref bbh );
        }
        #endregion //InitializeGlass
    
        #region WndProc
        private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
        {
            if ( msg == WM_DWMCOMPOSITIONCHANGED )
            {
                this.InitializeGlass( hwnd );
                handled = false;
            }
    
            return IntPtr.Zero;
        } 
        #endregion //WndProc 
    
        #endregion //Methods
    }
    

    And here’s a snippet of using the BlurWindow.

    var w = new BlurWindow();
    w.Width = 100;
    w.Height = 100;
    w.MouseLeftButtonDown += (s1, e1) => {
        ((Window)s1).DragMove();
        e1.Handled = true;
    };
    w.Background = new SolidColorBrush( Color.FromArgb( 75, 255, 0, 0 ) );
    w.Show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a borderless WPF window (WindowStyle=None) that can be moved by catching LeftMouseDown
I have a borderless and transparent window in WPF, with some fancy decoration at
I have an NSBorderlessWindow subclass of NSWindow with a transparent and non-opaque background (so
I have a borderless form (FormBorderStyle = None) with the height of 23 pixels
I have a borderless form which is always on top and with WS_EX_NOACTIVATE flag
I have a UserControl in WPF. I also have a Borderless window. To move
I have a borderless form that I'm docking onto the top edge of my
I have a borderless form that I would like to change the location of
Possible Duplicate: C# - Make a borderless form movable? I have made a form
I have a borderless window (BorderStyle = None) where I would like to allow

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.