rt,我用tabctrl控件跟属性页生成的标签,请教如何取得所有的标签名字呢?谢谢先

解决方案 »

  1.   

    BOOL GetItem( int nItem,  TCITEM* pTabCtrlItem ) const;
     TCITEM tcItem;
       CString pszString;   //  Get text for the tab item.
       GetDlgItemText(IDC_ITEM_TEXT, pszString);   //  Get the current tab item text.
       TCHAR buffer[256] = {0};
       tcItem.pszText = buffer;
       tcItem.cchTextMax = 256;
       tcItem.mask = TCIF_TEXT;
       m_TabCtrl.GetItem(0, &tcItem);
       TRACE(_T("Changing item text from %s to %s..."), tcItem.pszText, pszString);   //  Set the new text for the item.
       tcItem.pszText = pszString.LockBuffer();   //  Set the item in the tab control.
       m_TabCtrl.SetItem(0, &tcItem);   pszString.UnlockBuffer();
     
    tcItem.pszText就是标签名字
      

  2.   

    CTabCtrl::GetItemCTabCtrl m_tabal;
    TC_ITEM tcitem;
    m_tabal.GetItem(n,&tcitem); //n为索引值 第一个标签索引为0
    tcitem.pszText为标签名。要得到所有的写个循环