• Advertisement
Sign in to follow this  

Windows MFC Resizing Controls

This topic is 3734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello: Coming from C#, VB.Net and a little graphics programming, I am trying to pick up some of the GUI programming using C++ MFC. I have a parent form which calls a child dialog through the use of a menu option. I have the child dialog start maximized within the parent form. I want controls on the child form to resize accordingly. I also want the child diaog to resize with the form. How can I get the form width / height and how can I set them accordingly using MFC? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can use GetWindowRect to get the size and SetwindowPos to move/resize forms or controls.

TBH, I wouldn't recommend using MFC (unless you want to use some particular C library). C++ is a good language and has many strengths, but GUI programming with MFC is not one of them. If you're only targeting Windows, either Windows Forms or WPF are much nicer GUI toolkits.



Share this post


Link to post
Share on other sites
Thanks for the info. With all of the Microsoft technologies coming out it is hard to recognize, at times, which are the best to learn and pick up to stay current in the field. C# and VB.NET make a lot of sense to me, but it would be attractive to have a GUI toolkit that works well with C++. Does WPF work with C++. When I logged into Visual Studio 2008 (on Vista) I do not see a WPF project for C++, only C#.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement