void AdjustRect( BOOL bLarger, LPRECT lpRect );
Parameters
bLarger
Indicates which operation to perform. If this parameter is TRUE, lpRect specifies a display rectangle and receives the corresponding window rectangle. If this parameter is FALSE, lpRect specifies a window rectangle and receives the corresponding display rectangle.
lpRect
Pointer to a RECT structure that specifies the given rectangle and receives the calculated rectangle.
Remarks
Call this function to calculate a tab control’s display area given a window rectangle, or calculate the window rectangle that would correspond to a given display area.
Example
void CDialogDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
if(m_tabCtrl.m_hWnd == NULL)
return; // Return if window is not created yet.
RECT lpRect;
// Get size of dialog window.
GetClientRect(&lpRect);
// Adjust the rectangle to fit the tab control into the
// dialog's client rectangle.
m_tabCtrl.AdjustRect(FALSE, &lpRect);
// Move the tab control to the new position and size.
m_tabCtrl.MoveWindow(&lpRect, TRUE);
}
CTabCtrl Overview | Class Members | Hierarchy Chart
See Also CTabCtrl::SetItemSize, CTabCtrl::GetItemRect, CTabCtrl::AdjustRect