当前位置: 首页>>代码示例>>C++>>正文


C++ CComboBox::Clear方法代码示例

本文整理汇总了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;
}
开发者ID:ueverything,项目名称:mmo-resourse,代码行数:29,代码来源:FolderSet.cpp

示例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);
	}
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:34,代码来源:AutoConfigDlg.cpp

示例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);
}
开发者ID:ALEXLCC,项目名称:T3000_Building_Automation_System,代码行数:34,代码来源:NetworkControllView.cpp

示例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]);
}
开发者ID:myd7349,项目名称:Ongoing-Study,代码行数:8,代码来源:MFCExtensions.cpp

示例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);
}
开发者ID:vopl,项目名称:sp,代码行数:11,代码来源:financedemoDlg.cpp

示例6: ClearComboBox

void ClearComboBox(CComboBox &stComboBox)
{
	stComboBox.Clear();
	{
		int n = stComboBox.GetCount();
		for (int i=0; i<n; i++)
		{
			stComboBox.DeleteString(0);
		}
	}
}
开发者ID:mk-z,项目名称:Scan,代码行数:11,代码来源:StdAfx.cpp


注:本文中的CComboBox::Clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。