Bonjour,
Pour un projet, j'essaie de modifier le libell� d'un tab control.
Pour cela, j'ai rajout� une fonction dans le composant de Farscape
http://farscape.developpez.com/Samples/CxTabCtrl.zip
La fonction se base sur http://msdn.microsoft.com/en-us/library/dwzz1y47.aspx
la voici
J'appel la fonction dans un timer
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 void CXTabCtrl::SetTabText(int iIndex, LPCTSTR lpszCaption) { //http://msdn.microsoft.com/en-us/library/dwzz1y47.aspx // Get the current tab item text. TCITEM tcItem; TCHAR buffer[256] = {0}; tcItem.pszText = buffer; tcItem.cchTextMax = 256; tcItem.mask = TCIF_TEXT|TCIF_PARAM; this->GetItem(iIndex, &tcItem); // Set the new text for the item. tcItem.pszText = (LPTSTR) lpszCaption; // Set the item in the tab control. this->SetItem(iIndex, &tcItem); }
le probl�me , c'est qu'apr�s appel de la fonction , le texte est bien chang� mais le dialog incrust� dans le tab disparait.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 void CTabctrlDlg::OnTimer(UINT nIDEvent) { // TODO: Add your message handler code here and/or call default CTplDlgColor<CDialog>::OnTimer(nIDEvent); CTime curTime = CTime::GetCurrentTime(); CString m_time; m_time.Format("%02d:%02d:%02d", curTime.GetHour(), curTime.GetMinute(), curTime.GetSecond()); m_tabctrl.SetTabText(0,(LPCTSTR)m_time); }
Voila mon projet sous forme zipp�
http://cxtabctrl.site.voila.fr/Cxtabctrl.zip
Merci d'avance pour vos r�ponses
PS : j'ai aussi tent� avec�� ne marche pas
Code : S�lectionner tout - Visualiser dans une fen�tre � part tcItem.mask = TCIF_TEXT;
Partager