我在对话框的组合框里直接相应函数,中英文可以正常切换,程序如下:
void CMy111Dlg::OnSelchangeCombo1() 
{
// TODO: Add your control notification handler code here
int index;
index=((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel();
((CComboBox*)GetDlgItem(IDC_COMBO1))->GetLBText(index,m_langchoice);
    if (index==1)
    {
SetDlgItemText(IDOK,_T("确定"));
SetDlgItemText(IDCANCEL,_T("取消"));
    }
else
{
SetDlgItemText(IDOK,"ok");
SetDlgItemText(IDCANCEL,"cancel");
  }
}
但是我在组合框旁边加上确定取消按钮,先选择要转换的语言,再按确定按钮,在onok函数里相应,就没法转换,请教~~
void LangChoiceDlg::OnOK() 
{
// TODO: Add extra validation here
int index;
index=((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel();
((CComboBox*)GetDlgItem(IDC_COMBO1))->GetLBText(index,m_langchoice);
    if (index==1)
    {
SetDlgItemText(IDC_BUTTON1,_T("确定"));
// SetDlgItemText(IDCANCEL,_T("取消"));
    }
else
{
SetDlgItemText(IDC_BUTTON1,"ok");
// SetDlgItemText(IDCANCEL,"cancel");
  }
CDialog::OnOK();
}