Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Is it possible to use __ETWS_EX_CLOSE_ON_TABS with a CExtTabPageContainerWnd? Collapse All
Subject Author Date
Scott Moore Dec 7, 2006 - 6:16 PM

I’ve seen your example code that calls:

    m_wndMdiTabs.ModifyTabWndStyleEx(
        0,
        __ETWS_EX_CLOSE_ON_TABS|__ETWS_EX_CLOSE_ON_SELECTED_ONLY
        );

But I cannot find a method that allows me to do the same thing with CExtTabPageContainerWnd.

Is this possible?

Scott Moore Dec 12, 2006 - 12:26 PM

Thank you. For anybody reading this, you also need to override the virtual function void OnTabWndClickedItemCloseButton(LONG nItemIndex) to handle the close click. Otherwise the tab doesn’t close.

Is it possible to only display the close button for certain tabs? The main tab in my application cannot be closed and I would rather not display the close button for that tab, but for all others.

Technical Support Dec 13, 2006 - 6:08 AM

You can get a pointer to the CExtTabWnd::TAB_ITEM_INFO object by its index using CExtTabWnd::ItemGet() and invoke its CExtTabWnd::TAB_ITEM_INFO::ModifyItemStyleEx() method to add or remove the __ETWI_EX_NO_CLOSE_ON_TAB extended tab item style. This allows you to disable/enable the close button for a particular tab item. Of course, it is supposed that the feature that makes the close button on each tab is turned on for the entire CExtTabWnd window.

Technical Support Dec 9, 2006 - 11:46 AM

Here is the method you are looking for:

pTabPageContainer->GetSafeTabWindow()->ModifyTabWndStyleEx( 0, __ETWS_EX_CLOSE_ON_TABS|__ETWS_EX_CLOSE_ON_SELECTED_ONLY );