Changing the Tab Label

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

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

  • In this era of Big Data, enterprise applications create a large volume of data that may be structured, semi-structured, or unstructured in nature. Application development cycles are also shorter and application availability is a critical requirement. As such, enterprises are forced to look beyond traditional relational databases to NoSQL databases, such as MongoDB and Apache Cassandra, to onboard these next-generation applications. This guide discusses the backup and recovery challenges for distributed and …

  • Read the ebook Hybrid Cloud & Data Fabric for Dummies to learn how a Data Fabric can ease data management complexity within a hybrid cloud and help you maximize the control of your data — from anywhere at any time. Find out how to: Seamlessly and dynamically move data across private and public cloud resources Keep data secure and minimize business disruptions …

Most Popular Programming Stories

More for Developers

RSS Feeds

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