CTabCtrl::AdjustRect

计算选项卡控件的生成显示区域窗口矩形或计算将对应于特定的显示区域的窗口矩形。

void AdjustRect(
  BOOL bLarger,
  LPRECT lpRect 
);

参数

  • bLarger
    指示执行哪些操作。 如果此参数是 TRUE,lpRect 指定显示矩形并接收相应的窗口矩形。 如果此参数是 FALSE,lpRect 指定窗口矩形并接收相应的显示矩形。

  • lpRect
    为指定给定矩形并接收该计算矩形的 RECT 结构的指针。

示例

void CTabDlg::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 rect;

   // Get size of dialog window.
   GetClientRect(&rect);

   // Adjust the rectangle to fit the tab control into the 
   // dialog's client rectangle.
   m_TabCtrl.AdjustRect(FALSE, &rect);

   // Move the tab control to the new position and size.
   m_TabCtrl.MoveWindow(&rect, TRUE);   
}

要求

Header: afxcmn.h

请参见

参考

CTabCtrl选件类

层次结构图

CTabCtrl::SetItemSize

CTabCtrl::GetItemRect

CTabCtrl::AdjustRect