CStatusBarCtrl::SetText

Sets the text in the given part of a status bar control.

BOOL SetText(
   LPCTSTR lpszText,
   int nPane,
   int nType 
);

Parameters

  • lpszText
    Address of a null-terminated string specifying the text to set. If nType is SBT_OWNERDRAW, lpszText represents 32 bits of data.

  • nPane
    Zero-based index of the part to set. If this value is 255, the status bar control is assumed to be a simple control having only one part.

  • nType
    Type of drawing operation. It can be one of these values:

    • 0   The text is drawn with a border to appear lower than the plane of the status bar.

    • SBT_NOBORDERS   The text is drawn without borders.

    • SBT_OWNERDRAW   The text is drawn by the parent window.

    • SBT_POPOUT   The text is drawn with a border to appear higher than the plane of the status bar.

Return Value

Nonzero if successful; otherwise zero.

Remarks

The message invalidates the portion of the control that has changed, causing it to display the new text when the control next receives the WM_PAINT message.

Example

VERIFY(m_wndSBC.SetText(_T("Text For Pane 1"), 1, 0));

Requirements

Header: afxcmn.h

See Also

Reference

CStatusBarCtrl Class

Hierarchy Chart

CStatusBarCtrl::GetText

CStatusBarCtrl::GetTextLength

Other Resources

CStatusBarCtrl Members