Sign in to follow this  
rm2000

Windows MFC Resizing Controls

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this