次の方法で共有


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 クラス

階層図

その他の技術情報

CHeaderCtrl のメンバー