Resize a Dialog Box (MDI-Application)
-
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."
-
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."
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 notCDialog
based (especially when it should be non-modal). [EDIT] You may have a look at these CP articles: CResizableDialog[^] and ResizableLib[^]. -
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 notCDialog
based (especially when it should be non-modal). [EDIT] You may have a look at these CP articles: CResizableDialog[^] and ResizableLib[^].Thank you, works like a charm. ;)
"The Only Limit Is Only Your Imagination."