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 );


  • 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.

  • how to change the tab of color?

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

    Originally posted by: zht

    plese help.

  • 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;

  • 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.

  • Thanks for your teaching...

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

    Originally posted by: likehood


  • Thanks for the code.

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

    Originally posted by: Karlos

    Thanks, this works great.

  • 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.

  • 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?



  • good

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

    Originally posted by: wanliguo

    it's very good,thanks a lot

  • 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!?


  • Loading, Please Wait ...

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

Top White Papers and Webcasts

  • The open source cloud computing project OpenStack has come a long way since NASA and Rackspace launched it in 2010. Backed by leading technology infrastructure providers including Cisco, Dell, EMC, HP, IBM, Intel, and VMware, OpenStack underpins significant workloads at an increasingly diverse set of organizations, including BWM, CERN, Comcast, eBay, and Wal-Mart. For CIOs engaged in broader programs to win, serve, and retain customers -- and refocus business technology (BT) spend -- a planned and pragmatic …

  • Protect Your Business against Today's Rapidly Growing Threats Your business, employees, partners, and customers are depending more and more on network connectivity, and protecting data and infrastructure has moved to the top of the IT agenda. You can't arm yourself against today's rapidly increasing threats unless you understand how they work. Read this ebook to learn more about the top 10 DNS attacks that can target your external and internal DNS infrastructure, the impact they can have on the DNS server …

Most Popular Programming Stories

More for Developers

RSS Feeds

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