Hide

SftTabs/DLL 6.5 - Tab Control

Display
Print

MoveTab

Moves a tab within a tab control.

C

BOOL SftTabs_MoveTab(HWND hwndCtl, int fromIndex, int insertIndex);

C++

BOOL CSftTabs::MoveTab(int fromIndex, int insertIndex);

Parameters

hwndCtl

The window handle of the tab control.

fromIndex

The zero-based index of the tab to be moved to the new position defined by insertIndex.

insertIndex

The zero-based index of the insertion position where the tab defined by fromIndex will be moved to.

Returns

The return value is TRUE if moving the tab was successful, FALSE otherwise.

Comments

Moves a tab within a tab control.

All the attributes of the tab being moved are moved along with the tab.

The WM_SETREDRAW Windows message can be used to suppress the tab control from being redrawn when many tabs are moved.

Tabs can be deleted using DeleteTab. New tabs can be inserted at a specific location using InsertTab.

Examples

C

                    break;
                case SFTTABSN_SWITCHED:// we switched to a new page
                    SftTabs_ActivatePage(hwnd, hwndCtl, NULL, FALSE);
                    break;
                case SFTTABSN_DRAGDROP: { // {popup "tab reordering" pop_tabreordering}
                    SFTTABS_DRAGINFO dragInfo;
                    SftTabs_GetDragInfo(hwndCtl, &dragInfo);
                    if (dragInfo.targetAllowed) {
                        SftTabs_MoveTab(hwndCtl, dragInfo.reorderTab, dragInfo.targetTab);
                    }
                    break;
                 }
                }
                break;

            case IDOK:

C++

    pChildFrame->DestroyWindow();
}

void CMainFrame::OnTabsReordered()
{
    SFTTABS_DRAGINFO dragInfo;
    m_MDITab.GetDragInfo(&dragInfo);
    if (dragInfo.targetAllowed)
        m_MDITab.MoveTab(dragInfo.reorderTab, dragInfo.targetTab);
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if( !CMDIFrameWnd::PreCreateWindow(cs) )
        return FALSE;
    return TRUE;

See Also C/C++ API | C++ Classes | Notifications


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.