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

  • Companies undertaking an IT project need to find the right balance between cost and functionality. It's important to start by determining whether to build a solution from scratch, buy an out-of-the-box solution, or a combination of both. In reality, most projects will require some system tailoring to meet business requirements. Decision-makers must understand how much software development is enough and craft a detailed implementation plan to ensure the project's success. This white paper examines the different …

  • On-demand Event Event Date: February 12, 2015 The evolution of systems engineering with the SysML modeling language has resulted in improved requirements specification, better architectural definition, and better hand-off to downstream engineering. Agile methods have proven successful in the software domain, but how can these methods be applied to systems engineering? Check out this webcast and join Bruce Powel Douglass, author of Real-Time Agility, as he discusses how agile methods have had a tremendous …

Most Popular Programming Stories

More for Developers

RSS Feeds

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