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. General Dialog Size Question

General Dialog Size Question

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

    I have seen applications where the initial data entry dialog is small but when the user selects the 'Advance' option a lot more information is displayed on a larger dialog. Does anyone know how this is done as I would like to display a listCtrl, buttons and labels when the use selects the 'More Information' options on a small dialog. Regards,

    M D 2 Replies Last reply
    0
    • S sweep123

      I have seen applications where the initial data entry dialog is small but when the user selects the 'Advance' option a lot more information is displayed on a larger dialog. Does anyone know how this is done as I would like to display a listCtrl, buttons and labels when the use selects the 'More Information' options on a small dialog. Regards,

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      Does anyone know how this is done yes. when the user clicks on "more infor", you need to manually resize the dialog, that will make the controls "visible" or not to the user.


      Maximilien Lincourt Your Head A Splode - Strong Bad

      S 1 Reply Last reply
      0
      • M Maximilien

        Does anyone know how this is done yes. when the user clicks on "more infor", you need to manually resize the dialog, that will make the controls "visible" or not to the user.


        Maximilien Lincourt Your Head A Splode - Strong Bad

        S Offline
        S Offline
        sweep123
        wrote on last edited by
        #3

        A little more information would be useful. Do I use the SetWindowPos() to be a small dialog at initialisation and then resize to a larger dialog when the 'More Info' button is hit? Is it trial and error to guess the units/size?

        B 1 Reply Last reply
        0
        • S sweep123

          A little more information would be useful. Do I use the SetWindowPos() to be a small dialog at initialisation and then resize to a larger dialog when the 'More Info' button is hit? Is it trial and error to guess the units/size?

          B Offline
          B Offline
          benjymous
          wrote on last edited by
          #4

          MFC measures dialogs in a ratio of the font size, so it can be a bit hit or miss (try changing your system font size to be bigger, then run your app, and you'll see it's got bigger too!) I did something like what you're attempting in the past, and found the easiest solution was to add a simple frame at the bottom (the size of the area that gets shown/hidden) At run time, you can find the height of this control, and resize the dialog window accordingly - this'll make it much easier if you keep going back to add extra controls to the "hidden" part -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!

          V 1 Reply Last reply
          0
          • B benjymous

            MFC measures dialogs in a ratio of the font size, so it can be a bit hit or miss (try changing your system font size to be bigger, then run your app, and you'll see it's got bigger too!) I did something like what you're attempting in the past, and found the easiest solution was to add a simple frame at the bottom (the size of the area that gets shown/hidden) At run time, you can find the height of this control, and resize the dialog window accordingly - this'll make it much easier if you keep going back to add extra controls to the "hidden" part -- Help me! I'm turning into a grapefruit! Phoenix Paint - back from DPaint's ashes!

            V Offline
            V Offline
            Vikram Kashyap
            wrote on last edited by
            #5

            Hi, You can simply use MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRedraw = FALSE) on the click on 'More Settings' button and expand/collapse the dialog using required width and height. This will solve ur problem. Vikram Kashyap Sr. Software Engineer TechBooks International R&D Division

            1 Reply Last reply
            0
            • S sweep123

              I have seen applications where the initial data entry dialog is small but when the user selects the 'Advance' option a lot more information is displayed on a larger dialog. Does anyone know how this is done as I would like to display a listCtrl, buttons and labels when the use selects the 'More Information' options on a small dialog. Regards,

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

              sweep123 wrote: Does anyone know how this is done... Yes. See the "Expanding and Contracting your dialog boxes" section of this article for an example. Here is another example, in the "More / Less Detail on Dialog" section.


              "Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow

              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