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 index number of the item shown at the top of the tree control.
C
int WINAPI SftTree_GetTopIndex(HWND hwndCtl); int WINAPI SftTree_SetTopIndex(HWND hwndCtl, int index); int WINAPI SftTreeSplit_GetTopIndex(HWND hwndCtl); int WINAPI SftTreeSplit_SetTopIndex(HWND hwndCtl, int index);
C++
int CSftTree::GetTopIndex() const; int CSftTree::SetTopIndex(int index); int CSftTreeSplit::GetTopIndex() const; int CSftTreeSplit::SetTopIndex(int index);
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item which will become the first item displayed.
GetTopIndex returns the zero-based index of the item that is displayed as the first item in the tree control's client area.
SetTopIndex returns 0 if the function was successful, otherwise -1 is returned.
The GetTopIndex and SetTopIndex functions define the index number of the item shown at the top of the tree control.
An item must be visible before it can be displayed as the first item. SetItemShown can be used to make an item visible.
/* Make row header width optimal, so text and pictures are */ /* not clipped horizontally. */ SftTree_MakeRowHeaderOptimal(g_hwndTree);/* Make row header width optimal */ SftTree_RecalcHorizontalExtent(g_hwndTree);/* Update horizontal scroll bar */ SftTree_SetCurSel(g_hwndTree, 4); // select the 4th item SftTree_SetCaretIndex(g_hwndTree, 4); // and make it current SftTree_SetTopIndex(g_hwndTree, 0); // show the first item return 0; } case WM_DESTROY: DeleteObject(m_aThreeItemPictures[0].Picture.hBitmap);/* Default item pictures */ DeleteObject(m_aThreeItemPictures[1].Picture.hBitmap); DeleteObject(m_aThreeItemPictures[2].Picture.hBitmap); //DeleteObject(m_OtherItemPicture.Picture.hBitmap);/* Another item picture */
m_Tree.MakeColumnOptimal(-1, 0, FALSE);/* Make column widths optimal */ /* 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.RecalcHorizontalExtent(0, FALSE);/* Update horizontal scroll bar */ m_Tree.SetCurSel(4); // select the 4th item m_Tree.SetCaretIndex(4); // and make it current m_Tree.SetTopIndex(0); // show the first item return 0; } void CSampleView::OnSize(UINT nType, int cx, int cy) { CView::OnSize(nType, cx, cy);
See Also C/C++ API | Categories | Notifications