Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTabControl Handler
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabControl Handler

 Post Reply Post Reply
Author
Message
KumarCJ View Drop Down
Groupie
Groupie
Avatar

Joined: 02 April 2007
Location: India
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote KumarCJ Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabControl Handler
    Posted: 04 July 2011 at 7:53am
Hi,

We are using CXTPTabControl class for displaying the tab in 2nd pane of splitter window.

which handler we should use to catch click on Tab?

Currently we are using "SetSelectedItem(..)" but the issue with this is that when we select all the tab 1st time the controls come to "SetSelectedItem(..)" BUT when we try to select tabs 2nd time the control does not come to "SetSelectedItem(..)" so we are unable to handle the things for 2nd time click on tab.

The code we are using as below
void ABC::SetSelectedItem(CXTPTabManagerItem* pItem)
{
   HWND hWnd = pItem->GetHandle();
    CView * pView = (CView*)CWnd::FromHandlePermanent(hWnd);
   if (pView->IsKindOf(RUNTIME_CLASS(CMyView)))
   {
        GetParentFrame()->SetActiveView((CView *)pView);
   }
  
  CXTPTabControl::SetSelectedItem(pItem);
}

Please let us know which handler we should use, so that program control will come to handler for each click on tab,

Thanks,
Saket.
Back to Top
KumarCJ View Drop Down
Groupie
Groupie
Avatar

Joined: 02 April 2007
Location: India
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote KumarCJ Quote  Post ReplyReply Direct Link To This Post Posted: 06 July 2011 at 3:38am
Got it....

afx_msg void OnSelectedChanged(NMHDR* pNMHDR, LRESULT* pResult);

ON_NOTIFY(TCN_SELCHANGE, IDC_TABCONTROL, OnSelectedChanged)

void MyClass::OnSelectedChanged(NMHDR* pNMHDR, LRESULT* pResult)
{
    UNUSED_ALWAYS(pNMHDR);
    *pResult = 0;
    
    ...................
    ...................
    ...................

}// End of OnSelectedChanged(..)


Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.