我现在想用edit 控件显示接收的数据,当前的数据不能覆盖之前的数据,就象在DOS窗口下的一样!
哪一位好心人帮我一下!

解决方案 »

  1.   

    重载CEdit 例如 CHistoryEdit , 增加下面的函数
    void CHistoryEdit::AppendString
      (CString str)
    {
    CString   strBuffer;    // current contents of edit control  // Append string
      GetWindowText (strBuffer);
      if (!strBuffer.IsEmpty())
         strBuffer += "\r\n";
      strBuffer += str;
      SetWindowText (strBuffer);  // Scroll the edit control
      LineScroll (GetLineCount(), 0);
    }
      

  2.   

    http://www.codeguru.com/Cpp/controls/editctrl/print.php/c533/
      

  3.   


    CEdit * output;
    m_sShowText += "hello!\n";
                    //首先获得CEdit控件的句柄,
                    output =(CEdit *) GetDlgItem(IDC_SHOWTEXT);
                    //添加显示内容
    output->SetWindowText(m_sShowText);

    //滚动条的位置
    output->LineScroll(output->GetLineCount());