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 to change CMDIChildWnd's client area?

How do I to change CMDIChildWnd's client area?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
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.
  • U Offline
    U Offline
    User 4532
    wrote on last edited by
    #1

    By default, CMDIChildWnd use all its client area for a CView object, but I want leave some space to place another things, for example RulerBars, what can i do for it? Someone suggested me use two CDialogBars to implement it,but I don't think it is a good way, because the dialogbars can't overlap each other. I want to set view orgin at CPoint(16,16) relative to ChildWnd's client area orgin. What can i do for it?

    C 1 Reply Last reply
    0
    • U User 4532

      By default, CMDIChildWnd use all its client area for a CView object, but I want leave some space to place another things, for example RulerBars, what can i do for it? Someone suggested me use two CDialogBars to implement it,but I don't think it is a good way, because the dialogbars can't overlap each other. I want to set view orgin at CPoint(16,16) relative to ChildWnd's client area orgin. What can i do for it?

      C Offline
      C Offline
      Cristi Posea
      wrote on last edited by
      #2

      You should handle WM_SIZE and do the layout there. Try something like this: void CChildFrame::OnSize(UINT nType, int cx, int cy) { // CMDIChildWnd::OnSize(nType, cx, cy); CWnd::OnSize(nType, cx, cy); CWnd* pView = GetDlgItem(AFX_IDW_PANE_FIRST); if (pView != NULL) pView->MoveWindow(16, 16, cx - 16, cy - 16); GetMDIFrame()->OnUpdateFrameTitle(TRUE); } In this way, you get the space for the other controls. You can even paint the rulers directly in the frame's client area and not use controls. I would suggest you to use CControlBar-derived rulers too, but you decide.

      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