Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How do I maximize a child frame in code?

How do I maximize a child frame in code?

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike

    L T 2 Replies Last reply
    0
    • L Lost User

      Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Add this line to your OnCreateClient method in your CChildFrame class" MDIMaximize();

      M 1 Reply Last reply
      0
      • L Lost User

        Add this line to your OnCreateClient method in your CChildFrame class" MDIMaximize();

        M Offline
        M Offline
        mspitzer
        wrote on last edited by
        #3

        I may have something messed up elsewhere, because that is what I was doing to maximize it before. I tried it in several locations in the OnCreateClient (I already was using this method to set up a splitter window) and I still don't get the buttons or the contol menu in the frame's menu bar. Any other ideas? Thanks, Mike

        1 Reply Last reply
        0
        • L Lost User

          Hi all, I am writting an MFC app using the Doc/View and MDI. I can't figure out how to maximize my child frame when it gets created such that the restore, minimize, and close buttons appear up on the menu bar. I can get the window to maximize, but the buttons do not appear. I'm sure it is probably something simple that I am missing, but I just can't figure it out. When I click the maximize button I get the buttons, but I can't figure out how to do it in code. Thanks, Mike

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          Try this:

          void CChildFrame::ActivateFrame(int nCmdShow)
          {
          nCmdShow = SW_SHOWMAXIMIZED;
          CMDIChildWnd::ActivateFrame(nCmdShow);
          }

          ActivateFrame is a virtual function, you can use ClassWizard to quickly add declaration and default implementation. Tomasz Sowinski -- http://www.shooltz.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups