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
Deletes an item.
C
int WINAPI SftTree_DeleteString(HWND hwndCtl, int index); int WINAPI SftTreeSplit_DeleteString(HWND hwndCtl, int index);
C++
int CSftTree::DeleteString(int index); int CSftTreeSplit::DeleteString(int index);
hwndCtl
The window handle of the tree control.
index
Specifies the zero-based index of the item to be deleted.
The return value is the number of items remaining in the tree control. The return value is -1 if an error occurred.
The DeleteString function deletes an item.
If a parent item is deleted, dependents are deleted if the parent item is collapsed (dependents are not visible). If the parent item is expanded when it is deleted, its dependents are not deleted.
If a deletion callback routine has been defined (see SetDeleteCallback), the callback is invoked for each item deleted from the tree control. This allows application specific cleanup processing to take place for each item.
The WM_SETREDRAW Windows message (CWnd::SetRedraw) can be used to suppress the tree control from being redrawn when many items are deleted. The use of WM_SETREDRAW is strongly recommended when deleting many items from the tree control, as it avoids significant processing while items are deleted and drastically reduces the time needed. WM_SETREDRAW (FALSE) should be used once, then all items should be deleted followed by one final WM_SETREDRAW (TRUE) message.
In a tree control using a virtual data source, this function cannot be used and an error is returned.
See Also C/C++ API | Categories | Notifications