CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2011
    Posts
    51

    Close\Minimize\Maximize buttons are missing

    Hi All, I have a tricky question regarding the close\minimize\maximize buttons of a child frame. Hope someone can help.

    I create an MDI Framework and then a child frame inside it with a few. For some reason, the close\minimize\maximize buttons of the child frame do not show up, and thus it cannot be minimized or closed.

    However, it only happens if I use ShowWindow(SW_MAXIMIZE) in the child frame's OnCreate. Without this line it works fine.

    Besides, I checked its style, both WS_MINIMIZEBOX andWS_MAXIMIZEBOX are set. That is why ModifyStyle does not help.

    Can someone please shed some light?

    Thank you!

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Close\Minimize\Maximize buttons are missing

    They are not not "missing". They are at the right top corner of the window, below the mainframe titlebarName:  spy.jpg
Views: 153
Size:  43.1 KB.
    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2011
    Posts
    51

    Re: Close\Minimize\Maximize buttons are missing

    Quote Originally Posted by VictorN View Post
    They are not not "missing". They are at the right top corner of the window, below the mainframe titlebarName:  spy.jpg
Views: 153
Size:  43.1 KB.
    VictorN, yes, that is the right behavior I expect, but in my case they do not show even though both WS_MINIMIZEBOX andWS_MAXIMIZEBOX are set. See the picture
    Attached Images Attached Images  

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Close\Minimize\Maximize buttons are missing

    But is it a "classic" MDi or some other type like tabbed document or something else?
    Victor Nijegorodov

  5. #5
    Join Date
    Apr 2011
    Posts
    51

    Re: Close\Minimize\Maximize buttons are missing

    Quote Originally Posted by VictorN View Post
    But is it a "classic" MDi or some other type like tabbed document or something else?
    It is a classic one. In fact, if I "cascade" them from the menu "Window" and then maximize them again, the buttons will appear normally.

    It is kind of annoying. I am trying to figure out what flag is wrong in the beginning and what happened between "cascading" and "maximizing".

    Thanks a lot!

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Close\Minimize\Maximize buttons are missing

    I have no idea... I never saw such strange behavior.
    Victor Nijegorodov

  7. #7
    Join Date
    Apr 2011
    Posts
    51

    Re: Close\Minimize\Maximize buttons are missing

    Quote Originally Posted by VictorN View Post
    I have no idea... I never saw such strange behavior.
    Thanks anyway. I have to use a hack to solve the issue for now.

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Close\Minimize\Maximize buttons are missing

    Here's something to try: Create a new MDI project using the new project wizard. Check yhe docking behavior of the MDI windows.

    If it works in a new project, you'll know the problem is in your code. You can use spy++ to help determing styling differences between projects,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured