应用程序视图类继承自CEditView,想显示程序接收的信息,或者其他的错误提示等。要求能实现自动滚屏。
不想用TextOut(),要算坐标,因为有时候不知道信息有几行;请告知各种实现的方法!谢谢

解决方案 »

  1.   

    CEdit& edit = GetEditCtrl();
    edit.SetSel(-1, -1);
    edit.Replace("your text");
      

  2.   

    CEdit& edit = GetEditCtrl();
    edit.SetSel(-1, -1);
    edit.ReplaceSel("your text");
      

  3.   

    参照我给的一段代码:CEdit& theEdit = GetEditCtrl();DWORD dwMargins = theEdit.GetMargins();
    theEdit.SetMargins(20, HIWORD(dwMargins));
    theEdit.SetLimitText(10 * 1024);
    int nLine;
    CString strTmp,strText;
    MSG msg;
    for(int i=0;i<1000;i++)
    {
    while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
    {
    TranslateMessage(&msg);
    DispatchMessage(&msg);
    }
    strTmp.Format(_T("%d\r\n"),i*i);
    strText+=strTmp;
    theEdit.SetWindowText(strText);
    nLine=theEdit.GetLineCount();
    theEdit.LineScroll(nLine);
    }
      

  4.   

    谢谢兄弟们!
    我已经弄好了!
    CEdit& TempEdit = ((CSMSTranView*)((CMainFrame*)AfxGetApp()->GetMainWnd())->GetActiveView())->GetEditCtrl();
    TempEdit.SetSel(TempEdit.GetSel());
    TempEdit.ReplaceSel(lpszText);