Saturday, August 21, 2010

Question about handling tab control in Visual C++ ..........?

I have to display some toottip message on the tab buttons of a dialog, when the user moves mouse over the tab. I tried it by adding tooltip message by using AddTool() method of CTabCtrl object. But this shows the same message displayed with all tab buttons(within the same tab control object), So I should add different tooltip msg. for each of the tab in a tab control. But I could not do this task?? So plz help me (if possible write some code also in VC++).Question about handling tab control in Visual C++ ..........?
http://www.codeguru.com/cpp/controls/con鈥?/a>





Above link to code that assigns tooltip text to the individual tabs of a tab control.





CCustomTabCtrl is MFC control derived from the CWnd class.





CCustomTabCtrl - MFC Tab Control





CCustomTabCtrl::SetItemTooltipText





int SetItemTooltipText( int nItem, CString sText );





Return Value:





CTCERR_NOERROR if successful; otherwise, CTCERR_ERRORCODE.





Parameters:





nItem鈥擹ero-based index of the tab item whose tooltip text is to be set or one of these values:





CTCID_FIRSTBUTTON鈥擨D of the first button.


CTCID_PREVBUTTON鈥擨D of the previous button.


CTCID_NEXTBUTTON鈥擨D of the next button.


CTCID_LASTBUTTON鈥擨D of the last button.





sText鈥擯ointer to a string object that contains the new item tooltip text.





Remarks:





This function changes the tooltip text of a tab item.





______________________

No comments:

Post a Comment