Resetting dynamic layout controls

15 Views Asked by At

My CDialog has Cancel and Close buttons.

In the IDE they are both set to move 100 in X and Y.

In my OnInitDialog I call this method:

void CWeekendMeetingDlg::MoveCLoseButton()
{
    CRect   rtButton;
    CString strText;

    m_btnCancel.GetWindowRect(&rtButton);
    ScreenToClient(&rtButton);
    m_btnClose.MoveWindow(&rtButton);
}

This superimposes the Close button on the Cancel button (much like a property sheet).

My problem is that the Dynamic Layout Manager still thinks the Close button is in the original position. So when the dialog is resized and the user does something that causes the buttons to toggle visibility the Close button is in the wrong place.

0

There are 0 best solutions below