本文整理汇总了C++中CComboBox::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ CComboBox::Clear方法的具体用法?C++ CComboBox::Clear怎么用?C++ CComboBox::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CComboBox
的用法示例。
在下文中一共展示了CComboBox::Clear方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool CFolderSet::Initial()
{
CComboBox* pComboPack = (CComboBox*)GetDlgItem(IDC_COMBO_PACKAGE_TYPE);
if( pComboPack == NULL) return false;
pComboPack->Clear();
itTypeInfo it = m_PackageSets.begin();
for(;it != m_PackageSets.end();it++)
{
pComboPack->AddString( (*it).strFileName.c_str());
}
UpdatePackSet();
CButton* pForcePack = (CButton*)GetDlgItem(IDC_CHECK_FORCE_MODIFY_PACKTYPE);
if(pForcePack)
pForcePack->SetCheck(m_bForceModifyPackType);
CComboBox* pComboCompress= (CComboBox*)GetDlgItem(IDC_COMBO_COMPRESS_TYPE);
if(pComboCompress == NULL) return false;
pComboCompress->Clear();
it = m_CompresSets.begin();
for(;it != m_CompresSets.end();it++)
{
pComboCompress->AddString( (*it).strFileName.c_str());
}
UpdateCompressSet();
CButton* pForceCompress = (CButton*)GetDlgItem(IDC_CHECK_FORCE_MODIFY_COMPRESSTYPE);
if(pForceCompress)
pForceCompress->SetCheck(m_bForceModifyCompressType);
return true;
}
示例2: EnumRecentlyUsed
// the sub-class can call this method to fill out a combo box with the values stored in
// the recently used list.
void CAutoConfigDlg::EnumRecentlyUsed(CComboBox& cbRecentlyUsed)
{
cbRecentlyUsed.Clear();
CRegKey keyRecentConverterIDs;
CString strRegKey = GetRegKey();
if( keyRecentConverterIDs.Open(HKEY_CURRENT_USER, strRegKey) == ERROR_SUCCESS )
{
DWORD dwIndex = 0;
BOOL bStop = false;
do
{
DWORD dwValueType = 0, cbName = _MAX_PATH;
TCHAR lpName[_MAX_PATH]; lpName[0] = 0;
LONG lVal = RegEnumValue(keyRecentConverterIDs,dwIndex++,lpName,&cbName,0,&dwValueType,0,0);
if( (lVal == ERROR_SUCCESS) || (lVal == ERROR_MORE_DATA) )
{
// skip the default value
if( _tcslen(lpName) > 0 )
{
TRACE(_T("Found: (%s)"), lpName);
if( cbRecentlyUsed.FindStringExact(0,lpName) < 0 )
cbRecentlyUsed.AddString(lpName);
}
}
else
bStop = true;
} while( !bStop );
// select the first one so there's something in it.
cbRecentlyUsed.SetCurSel(0);
}
}
示例3: initTimeServerList
void CNetworkControllView::initTimeServerList()
{
m_szServers.clear();
CComboBox* pCbx = (CComboBox*)GetDlgItem(IDC_COMBO_TIMESERVERLIST);
pCbx->ResetContent();
pCbx->Clear();
for (int i = 0 ; i < 5; i++)
{
m_szServers.push_back(c_strTimeserverList[i]);
}
CString strIndex;
CString strValue;
for (int i = 6; i <= 10; i++)
{
strIndex.Format(_T("server%d"), i);
if(LoadTimeServerFromRegister(strIndex, strValue))
{
m_szServers.push_back(strValue);
}
else
{
break;
}
}
for (UINT n = 0; n < m_szServers.size(); n++)
{
pCbx->AddString(m_szServers[n]);
}
pCbx->SetCurSel(0);
}
示例4: CComboBox_Assign
void CComboBox_Assign(CComboBox &ctrlComboBox, const CStringArray &arrstrItems)
{
ASSERT(ctrlComboBox.GetSafeHwnd() != NULL);
ctrlComboBox.Clear();
for (int i = 0; i < arrstrItems.GetCount(); ++i)
ctrlComboBox.AddString(arrstrItems[i]);
}
示例5: initComboBox
//
// Helper utility to initialize a combo box from an array of text
//
static void initComboBox(CComboBox &b, const TCHAR *list[], int count, const TCHAR *initial)
{
b.Clear();
for (int i = 0; i < count; i += 2)
//The odd index are the display text, the even index are the keys
b.SetItemDataPtr(b.AddString(list[i + 1]), (void *)(list[i]));
b.SelectString(0, initial);
}
示例6: ClearComboBox
void ClearComboBox(CComboBox &stComboBox)
{
stComboBox.Clear();
{
int n = stComboBox.GetCount();
for (int i=0; i<n; i++)
{
stComboBox.DeleteString(0);
}
}
}