Why aren't my MDI child forms showing a shadow?

前端 未结 2 2086
小蘑菇
小蘑菇 2021-01-14 19:42

In my application when I make a form as a child form of my main MDI parent form, the child form stops showing Windows 7 default shadow effect behind forms. How do I get chil

2条回答
  •  抹茶落季
    2021-01-14 19:56

    This is normal, entirely by design. MDI child windows are not top-level windows, but rather a special type of child window that is designed to be hosted in an MDI parent window.

    The Desktop Window Manager (DWM), which is what is responsible for the Aero effects in Windows Vista and 7, only adds drop shadows and glass transparency to top-level windows. Your MDI child windows don't qualify for this treatment. In fact, the shadow isn't the only thing they're missing--they look like they're drawn using the Aero Basic theme, which is pretty visually jarring on a machine that is using the Aero theme for everything else.

    Unfortunately, there's no fix for this other than to switch away from MDI altogether. The multiple document interface has been pretty much deprecated nowadays anyway. Such interfaces provided more difficult for people to use than was originally expected, and they've fallen into almost complete disuse, particularly by Microsoft's own software. You'll notice that rather than using MDI, Microsoft Office uses multiple top-level windows. You should probably consider doing the same thing with your own software.

    Another popular alternative to MDI is a tabbed interface, commonly used by web browsers. Here, you have a single, top-level window and all of the child windows appear as "tabs" at the top of this main window. The user can switch among child windows much more easily and intuitively as tabs rather than as independent MDI children.

提交回复
热议问题