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
Defines the current item (caret location).
C
int WINAPI SftTree_GetCaretIndex(HWND hwndCtl); int WINAPI SftTree_SetCaretIndex(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetCaretIndex(HWND hwndCtl); int WINAPI SftTreeSplit_SetCaretIndex(HWND hwndCtl, int index);
C++
int CSftTree::GetCaretIndex() const; int CSftTree::SetCaretIndex(int index); int CSftTreeSplit::GetCaretIndex() const; int CSftTreeSplit::SetCaretIndex(int index);
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item which will become the current item.
GetCaretIndex returns the zero-based index of the item that has the focus rectangle.
SetCaretIndex returns 0 if the function was successful, otherwise -1.
The GetCaretIndex and SetCaretIndex functions define the current item (caret location).
GetCaretIndex retrieves the index of the item that has the focus rectangle. The item may or may not also be selected. The display of the focus rectangle can be controlled using SetShowFocus.
SetCaretIndex automatically makes the current item visible, its parents are expanded if necessary and the item is displayed in the tree window area. The item is not automatically selected.
/* Make row header width optimal, so text and pictures are */ /* not clipped horizontally. */ SftTree_MakeRowHeaderOptimal(g_hwndTree);/* Make row header width optimal */ SftTree_MakeColumnOptimal(g_hwndTree, 0);/* Only make the first column optimal */ SftTree_RecalcHorizontalExtent(g_hwndTree);/* Update horizontal scroll bar */ SftTree_SetCaretIndex(g_hwndTree, 0); SftTree_SetCurSel(g_hwndTree, 0); CopyPictureFromCurrentItem(g_hwndTree); // Set a timer so we can update our progress bars every once in a while SetTimer(hwnd, TIMERID, 333, NULL); return 0; } case WM_DESTROY:
/* Make row header width optimal, so text and pictures are */ /* not clipped horizontally. */ m_Tree.MakeRowHeaderOptimal(0, FALSE);/* Make row header width optimal */ m_Tree.MakeColumnOptimal(0);/* Only make the first column optimal */ m_Tree.RecalcHorizontalExtent(0, FALSE);/* Update horizontal scroll bar */ m_Tree.SetCaretIndex(0); m_Tree.SetCurSel(0); CopyPictureFromCurrentItem(); // Set a timer so we can update our progress bars every once in a while SetTimer(TIMERID, 333, NULL); return 0; }
See Also C/C++ API | Categories | Notifications