Search code examples
mfccaptionctabctrl

MFC, How do I change the capiton of TabCtrl


I know the InsertItem is for add new tab in tabctrl, but I need change the caption of tab after create, I use keyword tabctrl and caption to search the old article ,but no relation problem to solve it, hot do I change the caption of tab page...


Solution

  • OK,

    I got the solution, as follow code

    TC_ITEM TabCtrlItem;
    
    switch(m_tabCtrl.GetCurSel())
    {
    case TAB1:
        TabCtrlItem.mask = TCIF_TEXT;
        TabCtrlItem.pszText = _T("Some Text");
        m_tabCtrl.SetItem(TAB1, &TabCtrlItem );