Repository navigation
Description
This issue has been moved from a ticket on Developer Community.
- Create an MDI container as the main application window (typical). (Set IsMDIContainer to true)
- Via code, add MDI child window using the standard way (create, set MDIParent to "this", then Show).
The child windows always display with the Windows 7 Aero style, regardless of OS, the theme, or the user preferences. Our sales folks have complained that our application doesn't look modern because they demo on Win10 and the child windows look 10 years old and inconsistent.
No reasonable workaround is available. Several reports of the problem online and no confirmed workaround is available.
Original Comments
Feedback Bot on 7/30/2020, 02:21 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Amy Li [MSFT] on 7/30/2020, 04:17 PM:
Hi Glenn,
Thanks for sharing your problem at here. This is a nice suggestion but not a real issue. So we will convert it as a Suggestion Ticket.
Thanks for help us build a better visual studio!
Glenn Wickman on 7/30/2020, 11:16 PM:
This isn't a suggestion, it's pretty clearly a bug. Please review the attached screenshot that shows the incorrect non-client area painting of only MDIChild windows. Other top-level windows paint correctly so this is inconsistency at the very minimum and, on a larger level, the MDIChild windows are completely ignoring all the Windows settings (themes, user colors, etc). I would also point out that on certain operating systems like Windows Server 2012, the issue doesn't exist. So it's also a bug that randomly manifests depending on the version of Windows.
I'm also not sure why you've tagged this report as "needs more info". I've literally given the repro steps and screen shots. I'm happy to provide more information if you tell me what else you'd like.
Amy Li [MSFT] on 7/31/2020, 04:20 PM:
Hi Glenn,
We are sorry that our response was misleading to you. We verified the MDIChild on win10 & win8.1, the tesult result as following screenshot. So your issue is Form1 and ChildForm have different window style in win10?
Win10:
Win8.1:
Glenn Wickman on 7/31/2020, 11:52 PM:
(private comment, text removed)
Feedback Bot on 8/4/2020, 10:42 AM:
This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.
Original Solutions
(no solutions)


Activity
Amy-Li03 commentedon Aug 4, 2020
The same behaviour was observed in #3029 (comment)
Comments from customer:
The issue occurs on Windows 10, Windows Server 2016, AND Windows 8.1 (Your Win 8.1 screen shot appears to be from an installation that has had all UI styling turned off). In my tests, only Windows Server 2012 painted it according to the OS themes correctly. See attached screens.

Windows 8.1 Enterprise with Update (child windows incorrectly use Win7 styling)
Windows Server 2016 (Child windows incorrectly use Win7 styling)

Windows 10 (Child windows incorrectly use Win7 styling)

Windows Server 2012 (Child window is styled consistently with other windows)

So as you can see, the bug is that the MDI Child windows do not paint according to the OS/Theme styles. They always paint in the Windows 7 Aero style regardless of the actual settings (except on Windows Server 2012). Normal (non-MDIChild) windows paint correctly as do the system windows like MessageBox, so you end up with a UI that has a mix of old and correct styling.
kirsan31 commentedon Aug 4, 2020
RussKie commentedon Aug 4, 2020
weltkante commentedon Aug 5, 2020
This is not a WinForms issue, if you create a C++ project from the "MFC App" template in VS and chose MDI settings ("Multiple documents", "Tabbed documents" disabled, project style "MFC Standard") you get the same behavior. WinForms just exposes what the OS provides, any native MDI application (even if not using MFC) should look this way.
As far as I understand MDI is an obsolete technology and never got updated as far as visual styles are concerned. WinForms will not be able to fix this because it doesn't control rendering the frame.
Windows 10 MFC App using MDI:
MFC App Wizard settings I used to configure the template:
gwickman-dev commentedon Aug 5, 2020
@weltkante Yes, it does look like it's a bug in the Windows API in general- not specific to .NET or WinForms.
While it certainly looks like MDI support is not being maintained properly by Microsoft, I'm not seeing any evidence that it's an obsolete technology:
So the safe assumption would be that Microsoft doesn't want to fix it, doesn't have the resources/expertise to fix it, or can't find a reasonable workaround to offer. So they're essentially telling their developer community to "live with it" or invest millions into designing and rewriting the products to use a different UI/UX paradigms and then retrain the customer base on a new UI. And we all know how well that usually goes.
merriemcgaw commentedon Aug 6, 2020
While I can't make promises for another team, I'm going to reach out to Windows to find out if there is something we can do to make this better for our customers. I'm hopeful we can find some sort of work around that perhaps WinForms could add to our implementation of MDI Child Windows. I don't like the inconsistency myself one bit, and I'll push Windows towards a platform fix, or at least some way for us to work around the issue. I'll report back when I hear anything.
merriemcgaw commentedon Aug 6, 2020
Tagging @OliaG for discussion as well.
kirsan31 commentedon Nov 20, 2020
Any news?
GraPhiX-Guru commentedon Nov 20, 2020
31 remaining items
driver1998 commentedon Sep 20, 2022
@Amy-Li03
Not what I would say "consistent" but it proves a point. The title bar of MDI child window is not drawn by DWM, so the "Basic" visual style is used instead. But the default "Windows Aero" (aero.msstyles) still contains the old Windows-7 style visual styles borders.
The new theme that we now called "Windows Basic", (which is actually not a Basic theme but Aero Lite, aerolite.msstyles) , used in Windows Server 2012/R2, and newer versions of Server Core, does have an updated visual styles window border that matches the DWM border.
So the solution is to update aero.msstyles. Can't imagine why Windows 11 didn't do this (Windows 11 does have an overhaul to aero.msstyles).
memoarfaa commentedon Nov 8, 2022
@driver1998
@dreddy-work
@Amy-Li03
@kirsan31
@merriemcgaw
@KlausLoeffelmann
I create theme Form library that fixed this issue
memoarfaa/SkinFormCore
test project in .Net Core 6
WinFormsApp2.zip
Any suggestion is Welcome
MishaTy commentedon Nov 8, 2022
does that use the DwmWindow msstyle class?
kirsan31 commentedon Nov 8, 2022
@memoarfaa
Thank you for this work! And I want to notice that we already have one attempt.
My personal opinion is that I will not use a third-party mechanism until it is tested and added to WinForms.
memoarfaa commentedon Nov 8, 2022
@MishaTy
1- get current loaded msstyle form registry
(string)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ThemeManager", "DllName", string.Empty);2- get atlas image from msstyle Stream
GetThemeStream(hTheme, 0, 0, 213, out themeStream, out streamSize, hInstance);3- get operating system informathion from msstyle
var fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ThemeManager", "DllName", string.Empty).ToString());4- split atlas image according to DwmWindow msstyle classs
memoarfaa commentedon Nov 8, 2022
this them load default operating system setting if the developer doesn't change it not completely difference Theme
I tested it for a few months on most operating systems and on different devices
But testing and adding to WinForms here is welcome if the team agrees
kirsan31 commentedon Nov 8, 2022
@memoarfaa
In my experience, if you wish to get some valuable team feedback / help on any new feature, then you need to create a PR...
KlausLoeffelmann commentedon Nov 8, 2022
Thanks for the effort, we definitely appreciate!
I'll take a look - can't promise when exactly, but I wanted to give some feedback already that I have it on my radar. I am a bit reluctant though to see it's done by NC-rendering, to be honest - but then again I don't want to jump to conclusions before having taken a look at the demo, anyway.
KlausLoeffelmann commentedon Nov 9, 2022
@memoarfaa: Could you update the demo so it includes the necessary runtime components?
raphm4044 commentedon Apr 9, 2023
Hello, Since Windows 8, Windows uses DWM to render windows.
DWM window frame doens't apply to MDI child windows.
MishaTy commentedon Apr 10, 2023
The core issue is that the bitmaps in the visual style weren't updated in the WINDOW class. Dwm uses the DWMWINDOW class.
Splitwirez commentedon Jan 26, 2024
So uh...something interesting just popped up in the Windows Insider patch notes for build 26040: An updated setup UI.
New UI, but same old window frames. Sound familiar?
Revising the visual style to address this would both improve the new Windows Setup UI and resolve this long-standing MDI problem (which isn't even exclusive to WinForms, might I add).
So, with all that in mind...anyone know if the folks working on those parts of Windows even realize this is about as good a time as any to kill two birds with one stone?
fraaaaa4 commentedon Jan 26, 2024
They just need to update the bitmaps in aero.msstyles, and everything will look just fine.

AzAgarampur commentedon Jan 26, 2024
While they're at it they should also update the windows 7 control glyphs that are still in there... 🤔