Professional User Interface Suite, Copyright FOSS Software Inc. Help Published with Permission.

Create a class derived from CExtTabPageContainerWnd (or from any style class derived from it, e.g. CExtTabPageContainerWhidbeyWnd) and override the OnTabWndSelectionChange() virtual method. Please do not forget to call the method of its parent class if you want only to monitor selection events. The method is called twice.

First, the bPreSelectionTest parameter is true and you can return false if you want to skip the page selection (in other words, to disable page selection).

The second time the method is called when the selected tab item is already changed and this parameter is false.

virtual bool CMyTabPageContainerWnd::OnTabWndSelectionChange(
LONG nOldItemIndex,
LONG nNewItemIndex,
bool bPreSelectionTest
)
{
bool bRetVal =
CExtTabPageContainerWnd::OnTabWndSelectionChange(
nOldItemIndex,
nNewItemIndex,
bPreSelectionTest
);
if( bRetVal )
{
if( bPreSelectionTest )
{
///POINTA:
/// BEFORE A NEW PAGE IS ACTIVE
/// (the previous page window is still on the top
...
}
else
{
///POINTB:
/// THE NEW PAGE IS ACTIVE
/// (it is visible)
...
}
}
return bRetVal;
}