Share via


CStatusBar::SetPaneText

呼叫此成員函式將窗格設定為文字字串所指向的 lpszNewText。

BOOL SetPaneText(
   int nIndex,
   LPCTSTR lpszNewText,
   BOOL bUpdate = TRUE 
);

參數

  • nIndex
    文字要設定窗格中的索引。

  • lpszNewText
    為新的文字窗格的指標。

  • bUpdate
    如果 ,窗格失效,文字設定之後。

傳回值

如果不是零,則成功,則為 0。

備註

在呼叫 SetPaneText之後,您必須將更新 UI 管理員會顯示在狀態列的新文字。

範例

//Sets and displays text for pane index 3 and id ID_INDICATOR_SCRL
m_wndStatusBar.SetPaneText(3, _T("My New Status Bar Text"), TRUE);
//UI handler in the message map updates the status bar text:
ON_UPDATE_COMMAND_UI(ID_INDICATOR_SCRL, &CMainFrame::OnUpdatePane)
void CMainFrame::OnUpdatePane(CCmdUI* pCmdUI)
{
   pCmdUI->Enable();
}

需求

Header: afxext.h

請參閱

參考

CStatusBar 類別

階層架構圖

CStatusBar::GetPaneText