HeaderPane
Main
Hide
Share Link
Print

VirtualCount

Defines the number of items when using a virtual data source.

C

BOOL WINAPI SftBox_VirtualCount(HWND hwndCtl, LONG items, LONG itemsVisible, int maxLevel);

C++

BOOL CSftBox::VirtualCount(LONG items, LONG itemsVisible, int maxLevel);

Parameters

hwndCtl

The window handle of the combo box control.

items

Specifies the current number of items to be managed by the combo box control (including visible and hidden items).

itemsVisible

Specifies the current number of visible items to be managed by the combo box control. For a flat list (without hierarchy) itemsVisible must be equal to items.

maxLevel

Specifies the lowest level on which any item can appear. For a flat list (without hierarchy) this value must be set to 0.

Returns

The return value is TRUE if the function was successful, otherwise FALSE is returned. If the combo box control is not using a virtual data source (see VirtualInitialize), this function will fail. The function also fails if items is negative, if itemsVisible is greater than items, or if itemsVisible is 0 while items is greater than 0.

Comments

The VirtualCount function defines the number of items when using a virtual data source.

Whenever the number of items in the virtual data source changes, the application can call this function to notify the combo box control.

VirtualInitialize must be used to initialize a combo box control for use with a virtual data source.

GetCount can be used to retrieve the current number of items.

If the number of items is reduced so that the selected item no longer exists, the selection is removed (GetCurSel returns -1), the static portion or edit control portion no longer shows an item and the SFTBOXN_SELCHANGE notification is sent. Otherwise the index of the selected item remains unchanged, even if it no longer refers to the same item, and the static portion is updated to show the item's current data. It is up to the application to preserve or update the selection (see SetCurSel). The edit control portion of a simple or dropdown combo box is updated only by selecting the item again using SetCurSel.

Only flat lists (without hierarchy) are supported. To ensure compatibility with future releases of SftBox/DLL, items and itemsVisible must be equal and maxLevel must be set to 0.

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


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.