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

  • SEARCH
  • Home
  • 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 8225127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:18:36+00:00 2026-06-07T15:18:36+00:00

I am trying to use WPF to create a dock application in the style

  • 0

I am trying to use WPF to create a dock application in the style of the Dell Dock and it is going well so far.

My WPF form appears like so on my screen:

John Dock

The XAML for my form is below:

<Window x:Class="WpfApplication7.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="130" Width="525" Loaded="Window_Loaded" Background="Transparent" WindowStyle="None">
    <Grid>
    </Grid>
</Window>

I found a tutorial on the Microsoft website to add the Aero Glass effect. With this in mind, my code is below:

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;

namespace WpfApplication7
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            MakeTransparent();

            Topmost = true;


            var screenWidth = SystemInformation.PrimaryMonitorSize.Width;
            var startingPoint = (screenWidth / 2) - (Width / 2);

            Top = 2;
            Left = startingPoint;
        }

        private void MakeTransparent()
        {
            IntPtr mainWindowPtr = new WindowInteropHelper(this).Handle;
            HwndSource mainWindowSrc = HwndSource.FromHwnd(mainWindowPtr);
            mainWindowSrc.CompositionTarget.BackgroundColor = System.Windows.Media.Color.FromArgb(0, 0, 0, 0);

            Graphics desktop = Graphics.FromHwnd(mainWindowPtr);
            float DesktopDpiX = desktop.DpiX;
            float DesktopDpiY = desktop.DpiY;

            MARGINS margins = new MARGINS()
            {
                cxLeftWidth = 0,
                cxRightWidth = Convert.ToInt32(Width) * Convert.ToInt32(Width),
                cyTopHeight = 0,
                cyBottomHeight = Convert.ToInt32(Height) * Convert.ToInt32(Height)
            };

            int hr = DwmExtendFrameIntoClientArea(mainWindowSrc.Handle, ref margins);
        }

        [StructLayout(LayoutKind.Sequential)]
        public struct MARGINS
        {
            public int cxLeftWidth;
            public int cxRightWidth;
            public int cyTopHeight;
            public int cyBottomHeight;
        }

        [DllImport("DwmApi.dll")]
        public static extern int DwmExtendFrameIntoClientArea(IntPtr hwnd, ref MARGINS pMarInset);
    }
}

So far so good. However, my form is resizable which I don’t want so I set the ResizeMode property to NoResize and whenever I do this my form is nowhere to be found when launched.

Why does this happen?

I tried to get around this by resseting the form size on the SizeChanged event, but this only if you try to resize from the right or bottom of the form, if you try to resize from the top of left, it moves the form which I don’t want either.

Thanks

  • 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-07T15:18:38+00:00Added an answer on June 7, 2026 at 3:18 pm

    What is happening is since you are trying to extend your AeroBlur throughout the entire window, once you get rid of all window chrome it will not work, and since your Windows background color is Transparent it disappears on you. It does not appear that there is an way to extend Aero Glass easily without some Chrome which by allowing the form to be resized, gives you. The only link I could that mentions AeroBlur and Chromeless windows is this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Windows.Media.Capture.CameraCaptureUI() of Metro Style app in WPF application in
I'm trying to create a very simple WPF application. I'd like to have an
I am trying to create a WPF database application. There seems to be a
I'm trying to create a JPG from part of my WPF Applications. Like a
I am trying to create a file system when installing a WPF application. Currently
I am planning to create a screen saver. Thinking of trying out some WPF
I'm trying to create a tabbed sidebar with sections, like the following in WPF.
I'm trying to use EF Code First with my WPF application , the idea
I am trying to create a custom style for a WPF ComboBox but whenever
I have been trying to create a fairly simple application in WPF following the

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.