Removes all items from the combo box control.
C
void WINAPI SftBox_ResetContent(HWND hwndCtl);
C++
void CSftBox::ResetContent();
hwndCtl
The window handle of the combo box control.
The ResetContent function removes all items from the combo box control.
Once all items have been removed, the combo box no longer has a selected item. The text of the edit control portion of a simple or dropdown combo box is cleared. If an item was selected, the SFTBOXN_SELCHANGE notification is sent.
If a deletion callback routine has been defined (see SetDeleteCallback), the callback is invoked for each item as it is deleted from the combo box. This allows application specific cleanup processing to take place for each item.
If the dropdown portion is currently shown, it is closed, unless this has been disabled using SetRollupOnChange.
In a combo box control using a virtual data source, this function cannot be used. VirtualCount can be used to change the number of items in a virtual data source.
static void AddFonts(void)
{
LONG index, total;
TEXTMETRIC tm;
HDC hDC;
// clear (in case of refresh)
SftBox_ResetContent(m_hwndFonts);
// Add the font names, with a picture for the font type. Without a
// printer, the fonts of the display are added.
SftBox_Fonts(m_hwndFonts, -1, TRUE, m_hDC, SFTBOX_FONT_ALL);
// Get the default font height
hDC = GetDC(m_hwndFonts);
GetTextMetrics(hDC, &tm);
}
/////////////////////////////////////////////////////////////////////////////
// Data
void CMainDlg::AddFonts()
{
// clear (in case of refresh)
m_Fonts.ResetContent();
// Add the font names, with a picture for the font type. Without a
// printer, the fonts of the display are added.
m_Fonts.Fonts(-1, TRUE, m_hDC, SFTBOX_FONT_ALL);
// Get the default font height
TEXTMETRIC tm;See Also C/C++ API | Categories | Notifications