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. child frame fills main frame?

child frame fills main frame?

Scheduled Pinned Locked Moved C / C++ / MFC
wpfquestion
2 Posts 2 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
    LeeeNN
    wrote on last edited by
    #1

    In MDI project. I want my child frame fill main frame window. So I inplement this in BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs CWnd* pwnd = AfxGetMainWnd(); CRect rect; pwnd->GetClientRect( &rect ); cs.cx = rect.Width(); cs.cy = rect.Height(); if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } It's very close to success. But look closely, you will find a bit off. main frame overlapped child frame a little bit. I think that is because of edge of main frame window. But I am getting client area, it should not include edge right? any one can explain? :confused:

    O 1 Reply Last reply
    0
    • L LeeeNN

      In MDI project. I want my child frame fill main frame window. So I inplement this in BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying the CREATESTRUCT cs CWnd* pwnd = AfxGetMainWnd(); CRect rect; pwnd->GetClientRect( &rect ); cs.cx = rect.Width(); cs.cy = rect.Height(); if( !CMDIChildWnd::PreCreateWindow(cs) ) return FALSE; return TRUE; } It's very close to success. But look closely, you will find a bit off. main frame overlapped child frame a little bit. I think that is because of edge of main frame window. But I am getting client area, it should not include edge right? any one can explain? :confused:

      O Offline
      O Offline
      Owner drawn
      wrote on last edited by
      #2

      You have to do this inside WM_CHILDACTIVATE handler. Inside this handler call... MDIMaximize();

      Jesus Loves:rose:

      --Owner Drawn:rose: --Nothing special --Defeat is temporary but surrender is permanent --Never say quits --Jesus is Lord:rose:

      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