clistctrl没有立即显示像《统计》的文字
我有这样的代码将安装日志写入静态文本和列表控件,并且我有一个按钮来启动通过function onclickinstallbtn()
> nasther的安装程序,但是每当我调用<<代码> writelogtoscreen(),只有静态文本更改,并且列表中没有显示任何内容,直到完成onclickinstallbtn()
完成,并且该列表上的所有内容都显示为一个。
我该如何像静态文本一样立即显示出来?
WriteLogtoScreen(LPCTSTR sLog)
{
int iItems;
iItems = m_ListLog.GetItemCount();
m_ListLog.InsertItem(iItems, sLog);
m_ListLog.Update(iItems);
m_ListLog.SetItemText(iItems, 0, sLog);
m_ListLog.Update(iItems);
UpdateData(FALSE);
SetDlgItemText(IDC_STATIC, sLog);
}
I have a code like this to write install log to a static text and a list control, and i have a button to start the installer that be handle by function OnClickInstallBtn()
but every time I call the WriteLogtoScreen()
, only the static text change and nothing show up in the list until the OnClickInstallBtn()
is done and everything on that list show up all at one.
How can i make it show up right away like the static text?
WriteLogtoScreen(LPCTSTR sLog)
{
int iItems;
iItems = m_ListLog.GetItemCount();
m_ListLog.InsertItem(iItems, sLog);
m_ListLog.Update(iItems);
m_ListLog.SetItemText(iItems, 0, sLog);
m_ListLog.Update(iItems);
UpdateData(FALSE);
SetDlgItemText(IDC_STATIC, sLog);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要在类似的内容中明确强制列表的重新划分,则应调用
redrawwindow()
。You should call
RedrawWindow()
if you want to force the redraw of your list explicitly in something like this :