SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Retrieves the index of the next tab about to become active.
C
int SftTabs_GetNextTab(HWND hwndCtl);
C++
int CSftTabs::GetNextTab() const;
hwndCtl
The window handle of the tab control.
The return value is the index of the next tab about to become active.
The GetNextTab function retrieves the index of the next tab about to become active.
GetNextTab returns the index of the tab about to become active while processing a SFTTABSN_SWITCHING notification. The application can prevent the new tab from becoming active by sending a WM_CANCELMODE message to the tab control.
GetNextTab can also be used in a CSftTabsPage::AllowSwitch or CSftTabsWindowPage::AllowSwitch function, because these are called by the C++ class implementations while a SFTTABSN_SWITCHING notification is being processed.
GetNextTab can only be used while processing a SFTTABSN_SWITCHING notification.
This example prevents the user from switching to tab 0:
C
case WM_COMMAND: { HWND hwndCtl = (HWND) lParam; int id = LOWORD(wParam); int code = HIWORD(wParam); if (hwndCtl) { switch (id) { case IDC_TAB: switch (code) { case SFTTABSN_SWITCHING:// we're about to switch away from // the current page. If you need to know what the new // page will be use SftTabs_GetNextTab(hwndCtl). if (SftTabs_GetNextTab(hwndCtl) == 0) { SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; } if (!SftTabs_DeactivatePage(hwndParent, hwndCtl)) { // couldn't deactivate current page, so don't switch SendMessage(hwndCtl, WM_CANCELMODE, 0, 0); break; } break; case SFTTABSN_SWITCHED:// we switched to a new page SftTabs_ActivatePage(hwndParent, hwndCtl, NULL, FALSE); break; } break; } } break; }
C++
BOOL CPage2::AllowSwitch() { if (m_pTabCtl->GetNextTab() == 0)) return FALSE; return TRUE; // Allow switching away from this page }
See Also C/C++ API | C++ Classes | Notifications