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 dialog-based app and its controls

Resizing dialog-based app and its controls

Scheduled Pinned Locked Moved C / C++ / MFC
businesslearning
6 Posts 5 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.
  • J Offline
    J Offline
    Jamaica
    wrote on last edited by
    #1

    I have a dialog-based app that: - displays an image in a picture control (CStatic) - has a bunch of labelled text boxes (CStatic & CEdit) - has a few other bits & pieces (CScrollbar, CComboBox, CCheckBox...) The app needs to fill as much of the available screen real-estate on the computer running it. I can resize the main dialog window easily enough... but resizing the various controls on it looks like a tedious business. It's a one-off. Am I just as well off doing the layout calculations by hand, and giving every text box label an ID other than IDC_STATIC to do it... or is there something there that will so dramatically reduce the pain of all this that it is worth learning. On the face of it, CResizableDialog is more effort than it's worth... but I stand to be corrected.

    C A D 3 Replies Last reply
    0
    • J Jamaica

      I have a dialog-based app that: - displays an image in a picture control (CStatic) - has a bunch of labelled text boxes (CStatic & CEdit) - has a few other bits & pieces (CScrollbar, CComboBox, CCheckBox...) The app needs to fill as much of the available screen real-estate on the computer running it. I can resize the main dialog window easily enough... but resizing the various controls on it looks like a tedious business. It's a one-off. Am I just as well off doing the layout calculations by hand, and giving every text box label an ID other than IDC_STATIC to do it... or is there something there that will so dramatically reduce the pain of all this that it is worth learning. On the face of it, CResizableDialog is more effort than it's worth... but I stand to be corrected.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I believe there's a CP class that does this as well, but you'd have to have a look for yourself, I'm not sure. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • J Jamaica

        I have a dialog-based app that: - displays an image in a picture control (CStatic) - has a bunch of labelled text boxes (CStatic & CEdit) - has a few other bits & pieces (CScrollbar, CComboBox, CCheckBox...) The app needs to fill as much of the available screen real-estate on the computer running it. I can resize the main dialog window easily enough... but resizing the various controls on it looks like a tedious business. It's a one-off. Am I just as well off doing the layout calculations by hand, and giving every text box label an ID other than IDC_STATIC to do it... or is there something there that will so dramatically reduce the pain of all this that it is worth learning. On the face of it, CResizableDialog is more effort than it's worth... but I stand to be corrected.

        A Offline
        A Offline
        Anilkumar K V
        wrote on last edited by
        #3

        Handle WM_SIZE message

        1 Reply Last reply
        0
        • J Jamaica

          I have a dialog-based app that: - displays an image in a picture control (CStatic) - has a bunch of labelled text boxes (CStatic & CEdit) - has a few other bits & pieces (CScrollbar, CComboBox, CCheckBox...) The app needs to fill as much of the available screen real-estate on the computer running it. I can resize the main dialog window easily enough... but resizing the various controls on it looks like a tedious business. It's a one-off. Am I just as well off doing the layout calculations by hand, and giving every text box label an ID other than IDC_STATIC to do it... or is there something there that will so dramatically reduce the pain of all this that it is worth learning. On the face of it, CResizableDialog is more effort than it's worth... but I stand to be corrected.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          See the "Extras" section of this article.


          "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

          J 1 Reply Last reply
          0
          • D David Crow

            See the "Extras" section of this article.


            "The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb

            J Offline
            J Offline
            Jamaica
            wrote on last edited by
            #5

            Thanks guys --- I ended up biting the bullet and doing it "longhand". One day I may refactor it into something like what was in David's "extras"... but it would take considerably more sophistication to cope with the kind of form layout I have --- lines with 3 or 4 edit boxes across the full screen needing to be resized proportionally in the horizontal direction, while their labels stay constant size; image "window" resized to take up the remaining space among the edit boxes & buttons...

            S 1 Reply Last reply
            0
            • J Jamaica

              Thanks guys --- I ended up biting the bullet and doing it "longhand". One day I may refactor it into something like what was in David's "extras"... but it would take considerably more sophistication to cope with the kind of form layout I have --- lines with 3 or 4 edit boxes across the full screen needing to be resized proportionally in the horizontal direction, while their labels stay constant size; image "window" resized to take up the remaining space among the edit boxes & buttons...

              S Offline
              S Offline
              Shraddhan
              wrote on last edited by
              #6

              That's what I do too, doing each control 'by hand'. I reckon it can give a much better appearance, as various things need different changes. In fact, in some dialogs I even alter the layout as the size changes. It can be a bit of a pain to do, so it is worth doing methodically, and commenting clearly. It is easy to get into a muddle doing this kind of thing. Oh, I also take screen images and load these into graphics software so that I can enlarge them enough to be able to count the pisels. Shraddhan

              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