类似VC6.0调试窗口的自动滚动条问题

hustlotus 2009-01-09 06:56:47
随着程序的运行,调试窗口的文字不自动往下滚,望高手指教!!!
...全文
52 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
ilovedrv 2009-01-09
  • 打赏
  • 举报
回复
void CTestDlg::AppResultString(CString str)
{
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_OUTPUT); // Edit控件

CString strBuffer; // current contents of edit control
if (pEdit->GetLineCount() < 100 ) // 100是限制最大行数
pEdit->GetWindowText (strBuffer);
// Append string
if (!strBuffer.IsEmpty())
strBuffer += "\r\n";

COleDateTime dt = COleDateTime::GetCurrentTime();
CString time = dt.Format("%H:%M:%S");
strBuffer += time;
strBuffer += " ";
strBuffer += str;
pEdit->SetWindowText (strBuffer);

// Scroll the edit control
pEdit->LineScroll ( pEdit->GetLineCount(), 0);
}


15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧