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. resizing a view

resizing a view

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 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
    ROK_RShadow
    wrote on last edited by
    #1

    How would one resize a CView derived view based on a LPRECT structure? I have tried using SetWindowPos() but with no luck. Any help would be appreciated. Thank you.

    N 1 Reply Last reply
    0
    • R ROK_RShadow

      How would one resize a CView derived view based on a LPRECT structure? I have tried using SetWindowPos() but with no luck. Any help would be appreciated. Thank you.

      N Offline
      N Offline
      Neville Franks
      wrote on last edited by
      #2

      You need to resize the frame window that the view is inside. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

      R 1 Reply Last reply
      0
      • N Neville Franks

        You need to resize the frame window that the view is inside. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

        R Offline
        R Offline
        ROK_RShadow
        wrote on last edited by
        #3

        can you eloborate with some sample code. I was under the impression that I needed to resize the Frame window as well I tried to do SetWindowPos(((CMainFrame*)AfxGetMainWnd()), 0, 0, 50, 50, NULL) to see if it worked.. but that didn't work.. I also tried SetWindowPos(GetParent()....) but that didn't work either.

        N 1 Reply Last reply
        0
        • R ROK_RShadow

          can you eloborate with some sample code. I was under the impression that I needed to resize the Frame window as well I tried to do SetWindowPos(((CMainFrame*)AfxGetMainWnd()), 0, 0, 50, 50, NULL) to see if it worked.. but that didn't work.. I also tried SetWindowPos(GetParent()....) but that didn't work either.

          N Offline
          N Offline
          Neville Franks
          wrote on last edited by
          #4

          To resize the view I'd try: GetParentFrame()->SetWindowPos( &wndTop, 0, 0, 100, 100, SWP_NOACTIVATE | SWP_NOMOVE ); from within a derived CView class function. ie. 'this' = your view. or use: GetMyView()->GetParentFrame()->SetWindowPos( ... ) from code outside of the view. Of course the parent frame needs to be in its restored (normal) size, not maximized for this to work. Neville Franks, Author of ED for Windows. www.getsoft.com Make money with our new Affilate program

          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