比如我做了一个下载软件。
listctrl中有一列是“下载速度”
那么我如何实现下载速度的实时更新呢?
在哪里添加函数,消息响应?
要不要定时器
(下载功能中有checkspeed()检查速度的函数,并开了定时器
那么在listctrl中更新的时候是不是还要开一个定时器?)

解决方案 »

  1.   

    CListCtrl::Update
    BOOL Update( int nItem );Return ValueNonzero if successful; otherwise zero.ParametersnItemIndex of the item to be updated.ResCall 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.
      

  2.   

    还有,在单文档多视图中
    对于视图A中的listctrl,当我选中某项后
    我把鼠标移到另外的视图,
    如何保持A中仍然选择的该项?
      

  3.   

    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);
    }