CHeaderCtrl::Layout
Retrieves the size and position of a header control within a given rectangle.
BOOL Layout(
HDLAYOUT* pHeaderLayout
);
Параметры
- pHeaderLayout
Pointer to an HDLAYOUT structure, which contains information used to set the size and position of a header control.
Возвращаемое значение
Nonzero if successful; otherwise 0.
Заметки
This function is used to determine the appropriate dimensions for a new header control that is to occupy the given rectangle.
Пример
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