CTabCtrl控件标签的相关设置
?
原文鏈接: http://blog.csdn.net/happyhell/article/details/6012177
1、 獲得CTabCtrl標簽高度:
CRect rc; 
CTabCtrl *pTabCtrl = GetTabControl(); 
pTabCtrl->GetItemRect(&rc); 
int nHeight = rc.Height();
2、修改CTabCtrl標簽上的文字:
// In this example a CTabCtrl data member, m_TabCtrl, changes the
// text of the tabs in the tab control. A call to GetItem is used
// to get the current text, and then the text is changed. A call 
// to SetItem is used to update the tab with the new text.
void CTabDlg::OnChangeItem()
{
   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();
}
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);
?
?
?
?
?
?
轉載于:https://www.cnblogs.com/huhu0013/p/4576743.html
總結
以上是生活随笔為你收集整理的CTabCtrl控件标签的相关设置的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: Linux包管理速查表
- 下一篇: 海思hitool工具使用
