MFC VC++ アプリケーション Tip集 サイト


3章.CComboBoxクラス

3−1.コンボボックスで表示している文字列を取得



CString GetComboBoxStr( int nID )
{
	CString str;
	CComboBox * pCombo = ( CComboBox * )GetDlgItem( nID );
	int nIndex = pCombo->GetCurSel();
	if( nIndex != -1 ){
		pCombo->GetLBText( nIndex , str );
	}else{
		GetDlgItemText( nID , str );
	}
	return str;
}


Top へ戻る