CHeaderCtrl::Layout

检索一个标头控件的大小和位置在特定矩形中的。

BOOL Layout(
   HDLAYOUT* pHeaderLayout 
);

参数

  • pHeaderLayout
    HDLAYOUT 结构的指针,包含信息使用设置标头控件的大小和位置。

返回值

非零,如果成功;否则为0。

备注

此功能用于确定是所在给定矩形的新标头控件的相应维度。

示例

      HDLAYOUT  hdl;
      WINDOWPOS wpos;
      RECT      rc;

      // Reposition the header control so that it is placed at 
      // the top of its parent window's client area.
      m_myHeaderCtrl.GetParent()->GetClientRect(&rc);

      hdl.prc = &rc;
      hdl.pwpos = &wpos;
      if (m_myHeaderCtrl.Layout(&hdl))
      {
         m_myHeaderCtrl.SetWindowPos(
            CWnd::FromHandle(wpos.hwndInsertAfter),
            wpos.x,
            wpos.y,
            wpos.cx,
            wpos.cy,
            wpos.flags | SWP_SHOWWINDOW);
      }

要求

Header: afxcmn.h

请参见

参考

CHeaderCtrl选件类

层次结构图