listctrl中,如何实时更新数据?

szws 2006-05-18 11:33:27
比如我做了一个下载软件。
listctrl中有一列是“下载速度”
那么我如何实现下载速度的实时更新呢?
在哪里添加函数,消息响应?
要不要定时器
(下载功能中有checkspeed()检查速度的函数,并开了定时器
那么在listctrl中更新的时候是不是还要开一个定时器?)
...全文
338 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
striking 2006-05-21
  • 打赏
  • 举报
回复
BOOL CListCtrlEx::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
cs.style |= LVS_REPORT | LVS_SINGLESEL | LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED | LVS_SHOWSELALWAYS;

return CListCtrl::PreCreateWindow(cs);
}
szws 2006-05-21
  • 打赏
  • 举报
回复
怎么人这么少啊
szws 2006-05-18
  • 打赏
  • 举报
回复
还有,在单文档多视图中
对于视图A中的listctrl,当我选中某项后
我把鼠标移到另外的视图,
如何保持A中仍然选择的该项?
hamimelon 2006-05-18
  • 打赏
  • 举报
回复
CListCtrl::Update
BOOL Update( int nItem );

Return Value

Nonzero if successful; otherwise zero.

Parameters

nItem

Index of the item to be updated.

Remarks

Call this function to force the list view control to repaint the item specified by nItem. This function also arranges the list view control if it has the LVS_AUTOARRANGE style.

15,979

社区成员

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

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