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. setting the size of a CFrameWnd

setting the size of a CFrameWnd

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
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.
  • K Offline
    K Offline
    kfaday
    wrote on last edited by
    #1

    I've just started a new MFC program and the main window opens with a size i'd like to change. there's no create i can find. How do i resize the window? should i do it in the CMainFrame::OnCreate? thanks

    K O 2 Replies Last reply
    0
    • K kfaday

      I've just started a new MFC program and the main window opens with a size i'd like to change. there's no create i can find. How do i resize the window? should i do it in the CMainFrame::OnCreate? thanks

      K Offline
      K Offline
      kylur
      wrote on last edited by
      #2

      see "The MFC Answer Book", E. Kain, FAQ 3.9. Basically put a MoveWindow(...) in the OnCreate method. Regards, Kylur

      1 Reply Last reply
      0
      • K kfaday

        I've just started a new MFC program and the main window opens with a size i'd like to change. there's no create i can find. How do i resize the window? should i do it in the CMainFrame::OnCreate? thanks

        O Offline
        O Offline
        oleg63
        wrote on last edited by
        #3

        Hi, Use PreCreateWindow to set initial CMainFrame size. //////////////////////////////////////// // Set initial window size to 200 x 200 // BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { BOOL bRet = CFrameWnd::PreCreateWindow(cs); cs.cx = cs.cy = 200; return bRet; } Oleg.

        K 1 Reply Last reply
        0
        • O oleg63

          Hi, Use PreCreateWindow to set initial CMainFrame size. //////////////////////////////////////// // Set initial window size to 200 x 200 // BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) { BOOL bRet = CFrameWnd::PreCreateWindow(cs); cs.cx = cs.cy = 200; return bRet; } Oleg.

          K Offline
          K Offline
          kfaday
          wrote on last edited by
          #4

          thanks guys!

          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