清风的blog 优然探索

VC++ Radio Check

void CSkyEducationDlg::OnOK()
{
 // TODO: Add extra validation here
 //
 UpdateData(true);
 
 CString UserName,UserPwd;
 UserName = this->m_UserName;
 UserPwd = this->m_UserPwd; 
 CString sMessage,sTmp;
 if(this->m_Sex==0)
 {
  sMessage="性别:男";
 }
 else
 {
  sMessage="性别:女";
 }
 sMessage=sMessage+"\n您的爱好是:\n";

 CButton * pBtn = NULL ;
 pBtn = (CButton * )GetDlgItem(IDC_CHECK1);
 if(NULL != pBtn  && pBtn->GetCheck())
 {
  pBtn->GetWindowText(sTmp);
  sMessage += sTmp + "、";
  
 }
 pBtn = (CButton * )GetDlgItem(IDC_CHECK2);
 if(NULL != pBtn  && pBtn->GetCheck())
 {
  pBtn->GetWindowText(sTmp);
  sMessage += sTmp + "、";
 }
 pBtn = (CButton * )GetDlgItem(IDC_CHECK3);
 if(NULL != pBtn  && pBtn->GetCheck())
 {
  pBtn->GetWindowText(sTmp);
  sMessage += sTmp + "、";
 }
 pBtn = (CButton * )GetDlgItem(IDC_CHECK4);
 if(NULL != pBtn  && pBtn->GetCheck())
 {
  pBtn->GetWindowText(sTmp);
  sMessage += sTmp + "";
 }
 MessageBox(sMessage,"系统提示您");
}
 

2009年12月1日 | 发布:admin | 分类:技术文章 | 评论:0

发表留言: