Creating a resizable dialog in MFC
-
Hi, I'm sure this is probably the easiest question in the world but I can seem to find anything anywhere about how to do it. Basically I have created a dialog in an MFC program, but it is a fixed size, I want the user to be able to resize it, how do I do this? Cheers
-
Hi, I'm sure this is probably the easiest question in the world but I can seem to find anything anywhere about how to do it. Basically I have created a dialog in an MFC program, but it is a fixed size, I want the user to be able to resize it, how do I do this? Cheers
In the resource editor, open the properties for your dialog and select the Border style to be "Resizing". You will then need to handle the WM_SIZE message in your dialog's code (use ClassWizard) so that you can handle the resizing/repositioning of any child controls when the dialog is resized. This is a pretty common problem when using dialogs under MFC and there are a boatload of solutions, many of them on here. I recommend searching for Paolo Messina's dialog resizing solution which works nicely. Hope that helps...
-
In the resource editor, open the properties for your dialog and select the Border style to be "Resizing". You will then need to handle the WM_SIZE message in your dialog's code (use ClassWizard) so that you can handle the resizing/repositioning of any child controls when the dialog is resized. This is a pretty common problem when using dialogs under MFC and there are a boatload of solutions, many of them on here. I recommend searching for Paolo Messina's dialog resizing solution which works nicely. Hope that helps...
Thanks alot for that, knew it had to be something faily simple, that sorted it staight away. Cheers for help, much appreciated! :-D
-
Hi, I'm sure this is probably the easiest question in the world but I can seem to find anything anywhere about how to do it. Basically I have created a dialog in an MFC program, but it is a fixed size, I want the user to be able to resize it, how do I do this? Cheers
This might prove useful: http://www.codeproject.com/dialog/dlgresizearticle.asp It'll save you the trouble of manually repositioning controls in response to WM_SIZE messages. HTH