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

  • Enterprises are typically overwhelmed with incredible volumes of alerts that lack context and are not easily correlated across their technology stacks and silos. It can be incredibly challenging for large enterprises to detect and resolve incidents across multiple environments. When enterprises do detect challenges, communicating and acting efficiently through the right tools can be a daunting proposition. IT teams can provide real value if they collaborate and use agile methods for enterprise DevOps to move …

  • Microsoft® Office 365 is a top choice for enterprises that want a cloud-based suite of productivity/ collaboration applications. With Office 365, you get access to Microsoft™ Office solutions practically anytime, anywhere, on virtually any device. It's a great option for current Microsoft users who can now build on their experience with Microsoft™ solutions while enjoying the flexibility of a cloud-based delivery. But even organizations with no previous investment in Microsoft will find that …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date