1、获得CTabCtrl标签高度:CRect rc; CTabCtrl *pTabCtrl = GetTabControl(); pTabCtrl->GetItemRect(&rc); int nHeight = rc.Height();
2、修改CTabCtrl标签上的文字: void CDialogDlg::OnChangeItem()
{
TCITEM tcItem;
CString pszString;
// Get text for the tab item.
GetDlgItemText(IDC_ITEM_TEXT, pszString);
// Get the current tab item text.
tcItem.mask = TCIF_TEXT;
m_tabCtrl.GetItem(0, &tcItem);
// Set the new text for the item.
tcItem.pszText = pszString.GetBuffer(256);
// Set the item in the tab control.
m_tabCtrl.SetItem(0, &tcItem);
}
3、设置标签尺寸: pTabCtrl->SetItemSize(CSize(100,100));
4、设置标签字体:
m_Font.CreateFont(14,0,0,0,300,0,0,0,1,0,0,0,0,_T("Arial"));
pTabCtrl->SetFont(&m_Font);