//为设备环境句柄设置颜色 HBRUSH CContentsSubmitDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); int ctrid=pWnd->GetDlgCtrlID(); if(ctrid==IDC_EDIT4)//则 IDC_EDIT4 的颜色为下面的颜色 { pDC->SetTextColor(RGB(0,0,255)); pDC->SetBkMode(OPAQUE); pDC->SetBkColor(RGB(255,255,255)); return } return hbr; } brushBlack;
//组合框选中事件
void CContentsSubmitDlg::OnCbnSelchangeCombo1() { int nsel1=m_belong.GetCurSel(); switch(nsel1) { case 0 : m_ProjectName.ResetContent(); m_ProjectName.AddString("数据抓取
程序开发"); break; case 1: m_ProjectName.ResetContent(); m_ProjectName.AddString("
网络架设"); break; default: m_ProjectName.ResetContent(); m_ProjectName.AddString("您没有选择团队"); } }
//统计工作内容编辑框控件输入的行数(回车符表示换行),并将每行中以-号为分割符的内容写 入到数据库中
void CContentsSubmitDlg::OnBnClickedButton1() { UpdateData(true); projecttimes,weeks; workcontents=this->m_workcontents; employees=this->m_employee; projecttimes=this->m_projecttime; GetDlgItem(IDC_EDIT1)->GetWindowText(m_vdepartment); CString workcontents,employees,scheduals,completedates,departments,teams,projects,
departments=m_vdepartment; //****************处理
工作内容 CString strSrc =m_workcontents,strSrc1=m_workcontents; strSrc.TrimLeft(" "); strSrc.TrimRight(" "); strSrc.TrimRight(" "); strSrc.TrimRight(" "); strSrc.TrimRight("\t"); int countn=0;//统计工作内容的条数,以换行符号为标记 int pos;//\n 的位置 int k; CString contents1[10];//考虑到每个人提报最多内容不会超过 10 条,该数组用来存储每一 行 { pos=strSrc.FindOneOf("\n"); if(pos!=-1) { countn++; } else { } contents1[j]=strSrc.Left(pos);//将值存储到该数组[] strSrc=strSrc.Right(strSrc.GetLength()-pos-1); } countn=countn+1;//条数=count+1 CString contents[10]; CString resultcontents[10][3];//用该 2 维数组存储每条中每项的值 for(k=0;k
resultcontents[k][0]=strSrc1.Left(pos1); strSrc1=strSrc1.Right(strSrc1.GetLength()-pos1-1); pos1=strSrc1.FindOneOf("-"); resultcontents[k][1]=strSrc1.Left(pos1); strSrc1=strSrc1.Right(strSrc1.GetLength()-pos1-1); pos1=strSrc1.FindOneOf("-"); resultcontents[k][2]=strSrc1; int nsel=m_belong.GetCurSel(); if(nsel==CB_ERR) { AfxMessageBox("没有选团队名称"); return; } m_belong.GetLBText(nsel,m_vb
elong); int nsel1=m_week.GetCurSel(); if(nsel1==CB_ERR) { AfxMessageBox("没有选周会梯次"); return; } m_week.GetLBText(nsel1,m_vweek); int nsel2=m_ProjectName.GetCurSel(); if(nsel2==CB_ERR) { AfxMessageBox("没有选项目名称"); return; } m_ProjectName.GetLBText(nsel2