本文整理汇总了C++中ListBox::ClearItems方法的典型用法代码示例。如果您正苦于以下问题:C++ ListBox::ClearItems方法的具体用法?C++ ListBox::ClearItems怎么用?C++ ListBox::ClearItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListBox
的用法示例。
在下文中一共展示了ListBox::ClearItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillMajorTypes
void FillMajorTypes(ListBox& listbox)
{
listbox.ClearItems();
// Fill the specified list box with major type name/GUID
for (int i=0; i < NUM_MAJOR_TYPES; i++)
{
listbox.AddItem(majortypes[i].szName, (void *) majortypes[i].pGUID);
}
listbox.Select(0);
}
示例2: FillSubType
void FillSubType(ListBox& listboxMajor, ListBox& listboxMinor)
{
const GUIDINFO *pSubtype;
UINT nSelection = 0;
listboxMajor.GetCurrentSelection(&nSelection);
int nMajorType;
// First clear the subtype list
listboxMinor.ClearItems();
// If the "don't care" item was selected, clear and exit
if (nSelection == 0)
{
listboxMinor.AddString(L"<No subtypes>\0");
listboxMinor.Select(0);
return;
}
else
{
nMajorType = nSelection - 1;
}
// Determine how to fill the minor type list, based on the
// currently selected major type.
pSubtype = pSubTypes[nMajorType];
// If there's no associated subtype, just add a default
if (!pSubtype)
{
listboxMinor.AddString(L"<No subtypes>\0");
listboxMinor.Select(0);
return;
}
else
{
// Set a default item for "don't care"
listboxMinor.AddString(L"<Don't care>\0");
int i=0;
// Fill the subtype list box. Enter N item data to the N+1 list slot.
while (pSubtype[i].pGUID != NULL)
{
listboxMinor.AddItem(pSubtype[i].szName, (void *) pSubtype[i].pGUID);
i++;
}
listboxMinor.Select(0);
}
}