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. How to create a sizeable dialog (under MFC)?

How to create a sizeable dialog (under MFC)?

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestion
6 Posts 3 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
    Jay Jay
    wrote on last edited by
    #1

    I have already an dialog which is sizeable. Now i have a problem with this dialog. The dialog contains a ListControl. Now i want to set the size of the ListControl in proportion to the dialog when i use the maximize button. Can anyone help me with this problem? p.s.: it would be fine when you can explain it to me under MFC and no ATL because i don`t undersand this. :(( greets J.J. :cool:

    B B 2 Replies Last reply
    0
    • J Jay Jay

      I have already an dialog which is sizeable. Now i have a problem with this dialog. The dialog contains a ListControl. Now i want to set the size of the ListControl in proportion to the dialog when i use the maximize button. Can anyone help me with this problem? p.s.: it would be fine when you can explain it to me under MFC and no ATL because i don`t undersand this. :(( greets J.J. :cool:

      B Offline
      B Offline
      Brian D
      wrote on last edited by
      #2

      Use your WM_SIZE method and look at MoveWindow to resize the control based on the size of the Window you are in. You may want to capture the size of your dialog at the start of your program so you can compare the sizes. BD

      1 Reply Last reply
      0
      • J Jay Jay

        I have already an dialog which is sizeable. Now i have a problem with this dialog. The dialog contains a ListControl. Now i want to set the size of the ListControl in proportion to the dialog when i use the maximize button. Can anyone help me with this problem? p.s.: it would be fine when you can explain it to me under MFC and no ATL because i don`t undersand this. :(( greets J.J. :cool:

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

        How about somthing like this? [code] // Resize the list control contained in the view to // fill the entire view when the view's window is // resized. CMyView is a CView derived class. void CMyDlg::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy); // Resize list to fill the whole view. if(nType == SIZE_MAXIMIZED) m_List.MoveWindow (0, 0, cx, cy); } [/code]

        J 1 Reply Last reply
        0
        • B Burz

          How about somthing like this? [code] // Resize the list control contained in the view to // fill the entire view when the view's window is // resized. CMyView is a CView derived class. void CMyDlg::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy); // Resize list to fill the whole view. if(nType == SIZE_MAXIMIZED) m_List.MoveWindow (0, 0, cx, cy); } [/code]

          J Offline
          J Offline
          Jay Jay
          wrote on last edited by
          #4

          Thank you for help! Maybe you can help me by an other problem!? I want to get and set the position/size of a ListControl do you know how dose it work? Thank´s J.J.

          B 1 Reply Last reply
          0
          • J Jay Jay

            Thank you for help! Maybe you can help me by an other problem!? I want to get and set the position/size of a ListControl do you know how dose it work? Thank´s J.J.

            B Offline
            B Offline
            Burz
            wrote on last edited by
            #5

            GetWindowRect or GetClientRect And MoveWindow Or SetWindowPos

            J 1 Reply Last reply
            0
            • B Burz

              GetWindowRect or GetClientRect And MoveWindow Or SetWindowPos

              J Offline
              J Offline
              Jay Jay
              wrote on last edited by
              #6

              Hi, thak´s a lot for your help! Now it is working fine. :) J.J.

              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