Changing the Tab Label

The labels used by the tab control inside the property sheet is taken from the captions of the property pages. To change this label at runtime, we have to first get a pointer to the tab control object and call its SetItem() function. The following code changes the label of the first tab.
	CString sCaption = _T("New Caption");
	TC_ITEM tcItem;
	tcItem.mask = TCIF_TEXT;
	tcItem.pszText = (LPTSTR)((LPCTSTR)sCaption);
	GetTabControl()->SetItem(0, &tcItem );



Comments

  • How to change tab layout from horizontal to vertical

    Posted by Legacy on 04/28/2003 12:00am

    Originally posted by: Zulkefle Mohamad

    I'm already created a property sheet and it's working well. Now i want to change the tab size and layout from layout horizontal to vertical. Could you please give the procrdure to do this.

    Thank you.
    Zulkefle

    Reply
  • how to change the tab of color?

    Posted by Legacy on 03/31/2003 12:00am

    Originally posted by: zht

    plese help.

    Reply
  • Another way

    Posted by Legacy on 03/28/2003 12:00am

    Originally posted by: Art Gorr

    In a CPropertyPage derived class constructor:

    m_strCaption = _T("Hello world");
    m_psp.pszTitle = m_strCaption;
    m_psp.dwFlags |= PSP_USETITLE;

    Reply
  • I have some problem

    Posted by Legacy on 03/17/2003 12:00am

    Originally posted by: Dongoh

    In my code, I used CPropertySheet and CPropertyPage for implementing a wizard.
    
    

    To change each page's label, I overrided OnInitDialog in CMyPropertySheet.

    BOOL CMyPropertySheet::OnInitDialog()
    {
    BOOL bResult = CPropertySheet::OnInitDialog();

    TC_ITEM tcItem;
    tcItem.mask = TCIF_TEXT;
    tcItem.cchTextMax = _MAX_PATH;
    tcItem.pszText = _T("label");

    for( int i = 0; i < GetPageCount(); i++ )
    (CTabCtrl*)(GetTabControl())->SetItem( i, &tcItem );

    return bResult;
    }

    But, the only first page's label did not change.
    What I did miss or mistake?

    Please, leave some comment about my problem.
    Thank you in advance.

    Reply
  • Thanks for your teaching...

    Posted by Legacy on 02/07/2002 12:00am

    Originally posted by: likehood

    ^^

    Reply
  • Thanks for the code.

    Posted by Legacy on 12/05/2001 12:00am

    Originally posted by: Karlos

    Thanks, this works great.

    Reply
  • How to Change the tab color?

    Posted by Legacy on 11/08/2001 12:00am

    Originally posted by: Steven

    How to change the color of the tabs? I want a colorful tabctrl. thanks.

    Reply
  • Does anyone know how to change the colour of tabs?

    Posted by Legacy on 09/20/2001 12:00am

    Originally posted by: Dave

    the SetBkColor method is not supported for CTabCtrl. What is the easiest way to change the color of the active and non-active tabs?

    cheers

    Dave

    Reply
  • good

    Posted by Legacy on 08/19/2001 12:00am

    Originally posted by: wanliguo

    it's very good,thanks a lot

    Reply
  • Anyone know how to drag the tab control to another position in the sheet!?

    Posted by Legacy on 07/05/2001 12:00am

    Originally posted by: Chilli Palmer

    Anyone know how to drag the tab control to another position in the sheet!?

    Cheers.

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds