Skip to content

MDI child windows use hard-coded Visual Style Rendering #3691

Open

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


  1. Create an MDI container as the main application window (typical). (Set IsMDIContainer to true)
  2. 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

  1. Amy-Li03 commented on Aug 4, 2020

    @Amy-Li03
    Contributor

    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)
    149138-mdichild-win8-1

    Windows Server 2016 (Child windows incorrectly use Win7 styling)
    149139-mdichild-win2016

    Windows 10 (Child windows incorrectly use Win7 styling)
    149140-mdichild-win10

    Windows Server 2012 (Child window is styled consistently with other windows)
    149141-mdichild-win2012

    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.

  2. kirsan31 commented on Aug 4, 2020

    @kirsan31
  3. RussKie commented on Aug 4, 2020

    @RussKie
  4. added
    🪲 bug
    on Aug 4, 2020
  5. weltkante commented on Aug 5, 2020

    @weltkante
    Contributor

    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:

    grafik

    MFC App Wizard settings I used to configure the template:

    grafik

  6. gwickman-dev commented on Aug 5, 2020

    @gwickman-dev

    @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:

    • There are still plenty of apps that rely on this structure as the optimal way to present their UI (Photoshop for example).
    • I'm not seeing any documentation from Microsoft indicating that the MDI features are deprecated or recommendations that developers should abandon this UI paradigm.
    • This type of UI option is still supported in Visual Studio by way of their templates and in their documentation which only encourages their use.

    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.

  7. merriemcgaw commented on Aug 6, 2020

    @merriemcgaw
    Contributor

    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.

  8. merriemcgaw commented on Aug 6, 2020

    @merriemcgaw
    Contributor

    Tagging @OliaG for discussion as well.

  9. added
    area-MDI
    on Aug 11, 2020
  10. added
    waiting-review
    on Aug 27, 2020
  11. added this to the Future milestone on Aug 27, 2020
  12. kirsan31 commented on Nov 20, 2020

    @kirsan31
    Contributor

    Any news?

  13. GraPhiX-Guru commented on Nov 20, 2020

    @GraPhiX-Guru
  14. 31 remaining items

  15. driver1998 commented on Sep 20, 2022

    @driver1998

    @Amy-Li03

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

    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).

  16. memoarfaa commented on Nov 8, 2022

    @memoarfaa

    @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

    2022-11-04_14-53-31

    Untitled

    2022-11-08_15-08-06

  17. MishaTy commented on Nov 8, 2022

    @MishaTy

    does that use the DwmWindow msstyle class?

  18. kirsan31 commented on Nov 8, 2022

    @kirsan31
    Contributor

    @memoarfaa

    I create theme Form library that fixed this issue

    memoarfaa/SkinFormCore

    Any suggestion is Welcome

    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.

  19. memoarfaa commented on Nov 8, 2022

    @memoarfaa

    @MishaTy

    does that use the DwmWindow msstyle class?
    yes

    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);

    atlas

    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

  20. memoarfaa commented on Nov 8, 2022

    @memoarfaa

    @kirsan31

    I create theme Form library that fixed this issue
    memoarfaa/SkinFormCore
    Any suggestion is Welcome

    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.

    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

  21. kirsan31 commented on Nov 8, 2022

    @kirsan31
    Contributor

    @memoarfaa

    Any suggestion is Welcome

    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

    In my experience, if you wish to get some valuable team feedback / help on any new feature, then you need to create a PR...

  22. KlausLoeffelmann commented on Nov 8, 2022

    @KlausLoeffelmann
    Member

    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.

  23. KlausLoeffelmann commented on Nov 9, 2022

    @KlausLoeffelmann
    Member

    @memoarfaa: Could you update the demo so it includes the necessary runtime components?

  24. raphm4044 commented on Apr 9, 2023

    @raphm4044

    Hello, Since Windows 8, Windows uses DWM to render windows.

    DWM window frame doens't apply to MDI child windows.

  25. MishaTy commented on Apr 10, 2023

    @MishaTy

    The core issue is that the bitmaps in the visual style weren't updated in the WINDOW class. Dwm uses the DWMWINDOW class.

  26. Splitwirez commented on Jan 26, 2024

    @Splitwirez

    So uh...something interesting just popped up in the Windows Insider patch notes for build 26040: An updated setup UI.

    Comparison of old and new Windows Setup UI

    New UI, but same old window frames. Sound familiar?

    haha funy explanatory meme

    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?

  27. fraaaaa4 commented on Jan 26, 2024

    @fraaaaa4

    They just need to update the bitmaps in aero.msstyles, and everything will look just fine.
    immagine

  28. AzAgarampur commented on Jan 26, 2024

    @AzAgarampur

    While they're at it they should also update the windows 7 control glyphs that are still in there... 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🪲 bugarea-MDIarea-Themingenhancementtracking-external-issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions