BOOL CTest_comboDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
CComboBox* comboctrl1=(CComboBox*)GetDlgItem(IDC_COMBO1);
comboctrl1->AddString("°²»Õ");
comboctrl1->AddString("½ËÕ");
comboctrl1->AddString("ºþ±±");
comboctrl1->AddString("ËÄ´¨");
comboctrl1->SetCurSel(-1);
CComboBox* comboctrl2=(CComboBox*)GetDlgItem(IDC_COMBO2);
comboctrl2->SetCurSel(-1);
return TRUE; // return TRUE unless you set the focus to a control
}
void CTest_comboDlg::OnSelchangeCombo1()
{
// TODO: Add your control notification handler code here
int n=-1;
CComboBox* comboctrl1=(CComboBox*)GetDlgItem(IDC_COMBO1);
int index=comboctrl1->GetCurSel();
CString str_sel1;
comboctrl1->GetLBText(index,str_sel1);
if(!strcmp("°²»Õ",str_sel1))
n=0;
else if(!strcmp("½ËÕ",str_sel1))
n=1;
else if(!strcmp("ºþ±±",str_sel1))
n=2;
else if(!strcmp("ËÄ´¨",str_sel1))
n=3;
CComboBox* comboctrl2=(CComboBox*)GetDlgItem(IDC_COMBO2);
switch(n)
{
case 0:
comboctrl2->ResetContent();
comboctrl2->AddString("ºÏ·Ê");
comboctrl2->AddString("Îߺþ");
comboctrl2->AddString("³²ºþ");
comboctrl2->AddString("°ö²º");
break;
case 1:
comboctrl2->ResetContent();
comboctrl2->AddString("ÄϾ©");
comboctrl2->AddString("ËÕÖÝ");
comboctrl2->AddString("½Òõ");
comboctrl2->AddString("Ö£ÖÝ");
comboctrl2->SetCurSel(-1);
break;
case 2:
comboctrl2->ResetContent();
comboctrl2->AddString("Î人");
comboctrl2->AddString("Ò˲ý");
comboctrl2->AddString("ÏÌÄþ");
comboctrl2->AddString("ÉñÁú¼Ü");
break;
case 3:
comboctrl2->ResetContent();
comboctrl2->AddString("³É¶¼");
comboctrl2->AddString("ÃàÑô");
comboctrl2->AddString("¶¼½Ñß");
comboctrl2->AddString("è÷äü");
break;
default :
comboctrl2->ResetContent();
break;
}
}