程序在其他机器上执行结果也是这样。VC++会有问题吗?,我用的是在前年买的,在安装时,提示过有些文件的版本比现在旧,建议保留新版本时,选择了是,系统为WIN98联想随机版

解决方案 »

  1.   

    你在该控件上加了Change事件的响应消息函数了吧
      

  2.   

    SORRY 我忘了,刚才看了以下,我加了
      

  3.   

    Change事件的响应消息函数贴出来先
      

  4.   

    void CS9_1View::OnChangeMonthProduct() 
    {
    // TODO: If this is a RICHEDIT control, the control will not
    // send this notification unless you override the CFormView::OnInitDialog()
    // function and call CRichEditCtrl().SetEventMask()
    // with the ENM_CHANGE flag ORed into the mask.

    // TODO: Add your control notification handler code here
    CS9_1Doc *pDoc=GetDocument();
    UpdateData();
    if(pDoc->m_Month[m_nCurrentMonth].nProduct!=m_nMonthProduct)
    {
    pDoc->m_nTotalProduct+=m_nMonthProduct-pDoc->m_Month[m_nCurrentMonth].nProduct;
    CString str;
    str.Format("%d",pDoc->m_nTotalProduct);
    m_YearProduct.SetCaption(str);
    pDoc->m_Month[m_nCurrentMonth].nProduct=m_nMonthProduct;
    if(m_nCurrentMonth==0)
    m_sRiseRate="第一月无此值";
    else if(pDoc->m_Month[m_nCurrentMonth-1].nProduct==0)
    m_sRiseRate="上月无产值";
    else
    m_sRiseRate.Format("%2f%%",(pDoc->m_Month[m_nCurrentMonth].nProduct-pDoc->m_Month[m_nCurrentMonth-1].nProduct)/(float)(pDoc->m_Month[m_nCurrentMonth-1].nProduct)*100);
    pDoc->SetModifiedFlag();
    UpdateData(FALSE);
    }
    }
      

  5.   

    偶解决了!!!在change函数中,UpdateData(FALSE)后面加上这样一点代码
    CEdit* pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);
    pEdit->SetSel(512/*只要足够大就行*/ , -1);
      

  6.   

    我试过了,OK,真心谢谢asdfghjkl1107(脚右金黄),怎样给分?我给