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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. resizing of dialog boxes

resizing of dialog boxes

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 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.
  • B Offline
    B Offline
    b_girl
    wrote on last edited by
    #1

    I was wondering if it was at all possible, when 'maximizing' a dialog box, to make it so that it doesn't cover up the main menubar? When my dialog box maximizes itself, I want it to maximize to the size of the parent frame (if that's what the part below the menubar is called). Is this possible, if so, how?

    RaviBeeR 1 Reply Last reply
    0
    • B b_girl

      I was wondering if it was at all possible, when 'maximizing' a dialog box, to make it so that it doesn't cover up the main menubar? When my dialog box maximizes itself, I want it to maximize to the size of the parent frame (if that's what the part below the menubar is called). Is this possible, if so, how?

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      You can resize your dialog to its parent's client area, which you can get by calling GetClientRect(). You'll probably need to convert the rect to screen coordinates before resizing your dialog. Something like this (untested!):

      CMyDialog::doMaximize()
      {
      CRect rect;
      GetParent()->GetClientRect (&rect);
      ClientToScreen (&rect);
      MoveWindow (&rect);
      }

      /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

      B 1 Reply Last reply
      0
      • RaviBeeR RaviBee

        You can resize your dialog to its parent's client area, which you can get by calling GetClientRect(). You'll probably need to convert the rect to screen coordinates before resizing your dialog. Something like this (untested!):

        CMyDialog::doMaximize()
        {
        CRect rect;
        GetParent()->GetClientRect (&rect);
        ClientToScreen (&rect);
        MoveWindow (&rect);
        }

        /ravi Let's put "civil" back in "civilization" Home | Articles | Freeware | Music ravib@ravib.com

        B Offline
        B Offline
        b_girl
        wrote on last edited by
        #3

        Thanks.

        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