Problem with switching tabs on multi rows to  tabs on single rows

Posted on 2007-10-08
Last Modified: 2013-12-04
I created an ownerdrawn tab control (CTabCtrl).  I wanted to be able to set Tab Style on the fly.  For instance,
I have check box with two options - Tabs on single line, and Tabs on multiple row.
The problem is when user check on "Tabs on multiple rows", it shows Tabs on multiple rows, but it could not be changed back to show Tabs on single line again.  
I used following to switch to multiple lines:
ModifyStyle(ModifyStyle(TCS_MULTIROW, TCS_MULTIROW);

Any ideas?  appreciate any inputs!
Question by:yylibra61
    LVL 4

    Expert Comment

    I can't speak to your particlar case, but you might have to invalidate the control or force an update/paint/refresh after the change. If nobody else comes along with a better idea, you might try looking for an MFC method on the control that will either do Invalidate, Paint, Refresh, Update, etc.

    Good luck!
    LVL 39

    Accepted Solution

    The switch to multiple lines should be

       m_tab.ModifyStyle(0, TCS_MULTIROW);

    and back:

       m_tab.ModifyStyle(TCS_MULTIROW, 0);

    The first argument is what flags are to remove and the second what flags are to add.

    Regards, Alex


    Author Comment

    It worked!  thanks!

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now