次の方法で共有


CHeaderCtrl::Layout

指定された四角形内のヘッダー コントロールのサイズと位置を取得します。

BOOL Layout(
   HDLAYOUT* pHeaderLayout 
);

パラメーター

  • pHeaderLayout
    情報を含む HDLAYOUT の構造体へのポインター、ヘッダー コントロールのサイズと位置を設定するために使用します。

戻り値

正常終了した場合は 0 以外を返します。それ以外の場合は 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);
      }

必要条件

ヘッダー: afxcmn.h

参照

関連項目

CHeaderCtrl クラス

階層図