注意是ON_CBN_SELCHANGE
void CGxSingleCamDlg::OnCbnSelchangeTypeofWorkpiece()
{
CString TypeofWorkpiece = "";
int nCurSel = 0;
CComboBox* pCombo = NULL;
pCombo = (CComboBox*)GetDlgItem(IDC_COMBO1);
nCurSel = pCombo->GetCurSel();
//typesofworkpiece = nCurSel + 1;
//TypeofWorkpiece.Format("%d", nCurSel);
pCombo->GetLBText(nCurSel, TypeofWorkpiece); //将下拉菜单所选择的内容传到TypeofWorkpiece中
SetDlgItemText(IDC_EDIT4, TypeofWorkpiece);
}