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. SDI Form Resize

SDI Form Resize

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

    hi, I am using a SDI FormView-derived Form. I am dynamically creating controls which are placed on the form. I need to resize the vertical size of the form as I fill it. I have placed a scroll bar on the form. I managed to do the following: void CStocks: nSize(UINT nType, int cx, int cy) { CFormView: nSize(nType, cx, cy); CRect txtRect, clientRect; GetWindowRect(txtRect); ScreenToClient(txtRect); GetWindowRect(clientRect); CStatic caramba[50]; CString g; for (int i=0;i<50;i++) { g.Format("%d", i); caramba[i].Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this); txtRect.bottom += 50; } MoveWindow(txtRect); As you can see I created quite a few objects just to test the scroll facility. The Scroll Bar appears but my Toolbar and Statusbar disappeared. Can anyone help me with an example or correction of my errors. Thanking you in anticipation. Rui

    J 1 Reply Last reply
    0
    • R Ruca

      hi, I am using a SDI FormView-derived Form. I am dynamically creating controls which are placed on the form. I need to resize the vertical size of the form as I fill it. I have placed a scroll bar on the form. I managed to do the following: void CStocks: nSize(UINT nType, int cx, int cy) { CFormView: nSize(nType, cx, cy); CRect txtRect, clientRect; GetWindowRect(txtRect); ScreenToClient(txtRect); GetWindowRect(clientRect); CStatic caramba[50]; CString g; for (int i=0;i<50;i++) { g.Format("%d", i); caramba[i].Create(g, WS_CHILD|WS_VISIBLE|SS_CENTER|WS_BORDER, CRect(10, i*10, 120, i*10+50), this); txtRect.bottom += 50; } MoveWindow(txtRect); As you can see I created quite a few objects just to test the scroll facility. The Scroll Bar appears but my Toolbar and Statusbar disappeared. Can anyone help me with an example or correction of my errors. Thanking you in anticipation. Rui

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      //inside your view
      GetParentFrame()->RecalcLayout();
      ResizeParentToFit(FALSE);

      Maybe one of these two sentences (or both combined) gives some results. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      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