struct ITEM { //HWND h; CWnd* wnd; //our control int nID; int iTab; //which tab it belongs to BOOL bTabStop; //does this control allow tabstop };
m_cTab.InsertItem(0,"Register new user"); m_cTab.InsertItem(1,"Identify fingerprints"); void CMyTabCtrl::ShowTab(int iTab) { iCtrl = -1;//reset any control which may be selected in a tab if(iCurrentTab == iTab)//already focused on selected tab { return; } //save old tab location so we can hide its controls int iOldTab = iCurrentTab; iCurrentTab = iTab; //check if tab is in focus, if not, put it in focus int t = GetCurFocus(); if(iTab != t) { SetCurSel(iTab); } //hide old tabs controls, show the selected tab's controls INT_PTR iCount = obArray.GetCount(); for(INT_PTR i=0; i<iCount; i++) { ITEM* pItem = (ITEM*)obArray[i]; if(pItem->iTab == iOldTab) { pItem->wnd->ShowWindow(SW_HIDE); } else if(pItem->iTab == iCurrentTab) { pItem->wnd->ShowWindow(SW_SHOW); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)