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. Resize a Dialog Box (MDI-Application)

Resize a Dialog Box (MDI-Application)

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

    Hi all, I have an MDI application under MFC. When I click on a menu I have a dialog based view (CDialog) which contains a button. What I need is when I click the button I want to resize my Dialog and set it to a new position. I tried the MoveWindow, SetWindowPos but nothing changed. I think that those functions don't work with MDI or I missed sthing. So people: How can I resize and move my Dialog to a new location point. Thank you in advance.

    "The Only Limit Is Only Your Imagination."

    J 1 Reply Last reply
    0
    • S Schehaider_Aymen

      Hi all, I have an MDI application under MFC. When I click on a menu I have a dialog based view (CDialog) which contains a button. What I need is when I click the button I want to resize my Dialog and set it to a new position. I tried the MoveWindow, SetWindowPos but nothing changed. I think that those functions don't work with MDI or I missed sthing. So people: How can I resize and move my Dialog to a new location point. Thank you in advance.

      "The Only Limit Is Only Your Imagination."

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      Moving the dialog by code should work like moving it by mouse. This does not depend on the application type. Resizing is disabled for CDialog derived classes. To be resizable the window must have a different style (you may search for resizable dialogs). But it usually requires a lot of code to implement resizing with dialogs. It may be simpler to create your own window class that is not CDialog based (especially when it should be non-modal). [EDIT] You may have a look at these CP articles: CResizableDialog[^] and ResizableLib[^].

      S 1 Reply Last reply
      0
      • J Jochen Arndt

        Moving the dialog by code should work like moving it by mouse. This does not depend on the application type. Resizing is disabled for CDialog derived classes. To be resizable the window must have a different style (you may search for resizable dialogs). But it usually requires a lot of code to implement resizing with dialogs. It may be simpler to create your own window class that is not CDialog based (especially when it should be non-modal). [EDIT] You may have a look at these CP articles: CResizableDialog[^] and ResizableLib[^].

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

        Thank you, works like a charm. ;)

        "The Only Limit Is Only Your Imagination."

        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