Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Toolmaker

MFC window resizing not working

This topic is 5353 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

I am having problems resizing my dialogbox in MFC. My window needs to be the same size as the bottom of a button + 10. When pressing the button the window is resized to show an extra control which isn''t always needed. Moving it onto a different tab or in a new window isn''t really an option, since the control relies on a different one aswell. What is wrong with this code:
    CRect WndSize;
    CRect BtnPos;
    // m_pgBlack is derived from CPropertyPage

    m_pgBlack.m_btnCalendar.GetWindowRect(&BtnPos);
    m_pgBlack.GetWindowRect(&WndSize);
    ScreenToClient(&WndSize);
    ScreenToClient(&BtnPos);
    WndSize.right  -= WndSize.left;
    WndSize.bottom = BtnPos.bottom;
This is the result, I removed some of the interface, since I dunno if they would like it if I showed around the interface.

Share this post


Link to post
Share on other sites
Advertisement
If you are not doing it already, check out CWnd::MoveWindow();

// Javelin
-- Why do something today when you can do it tomorrow... --

Share this post


Link to post
Share on other sites
Oops, seems like I got the
SetWindowPos(NULL, Rect.left, Rect.top, Rect.right, Rect.bottom, SWP_NOZORDER);
call.

I am resizing the propertypage, can I use Movewindow for that aswell? I just try and see wat happens.

Toolmaker



-Earth is 98% full. Please delete anybody you can.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!