В OnSize() вот так например:
Код | void CProjectView::OnSize(UINT nType, int cx, int cy) { CFormView::OnSize(nType, cx, cy); CRect P, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11; GetClientRect(P); if (m_wndStaticYield.GetSafeHwnd()) { m_wndStaticYield.GetWindowRect(P1); P1.left = 10; P1.right = P.Width() / 2 - 5; P1.bottom = P.top + 5 + P1.Height(); P1.top = P.top + 5; m_wndStaticYield.MoveWindow(P1, TRUE); } int ibtn_height = 0; if (m_wndBtnYieldCalc.GetSafeHwnd()) { m_wndBtnYieldCalc.GetWindowRect(P3); ibtn_height = P3.Height(); P3.right = P1.left + 10 + P3.Width(); P3.left = P1.left + + 10; P3.top = P1.bottom - 15 - 2 * ibtn_height; P3.bottom = P3.top + ibtn_height; m_wndBtnYieldCalc.MoveWindow(P3, TRUE); } if (m_wndBtnYieldFact.GetSafeHwnd()) { m_wndBtnYieldFact.GetWindowRect(P4); P4.right = P1.left + 10 + P4.Width(); P4.left = P1.left + 10; P4.top = P3.bottom + 5; P4.bottom = P4.top + ibtn_height; m_wndBtnYieldFact.MoveWindow(P4, TRUE); } if (m_wndBtnDelYield.GetSafeHwnd()) { m_wndBtnDelYield.GetWindowRect(P10); P10.right = P3.right + 15 + P10.Width(); P10.left = P3.right + 15; P10.top = P1.bottom - 15 - 2 * ibtn_height; P10.bottom = P10.top + ibtn_height; m_wndBtnDelYield.MoveWindow(P10, TRUE); } if (m_wndBtnSetMain.GetSafeHwnd()) { m_wndBtnSetMain.GetWindowRect(P11); P11.right = P3.right + 15 + P11.Width(); P11.left = P3.right + 15; P11.top = P10.bottom + 5; P11.bottom = P11.top + ibtn_height; m_wndBtnSetMain.MoveWindow(P11, TRUE); } if (m_wndBtnStat.GetSafeHwnd()) { m_wndBtnStat.GetWindowRect(P5); P5.left = P1.right - 10 - P5.Width(); P5.right = P1.right - 10; P5.top = P1.bottom - 10 - P5.Height(); P5.bottom = P1.bottom - 10; m_wndBtnStat.MoveWindow(P5, TRUE); } }
|
|