CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    CListCtrl update

    How can I update a CListCtrl automaticaly when using a dynaset database.


  2. #2
    Join Date
    May 1999
    Location
    Canada
    Posts
    36

    Re: CListCtrl update

    in OnUpdate of the view I use this code to force a refresh of the CListCtrl


    LV_ITEM lvi;
    memset(&lvi, 0, sizeof(lvi));
    lvi.mask = LVIF_TEXT | LVIF_PARAM;
    lvi.pszText = LPSTR_TEXTCALLBACK;
    lvi.iSubItem = 0;

    for (i=0; i < NumOfData; i++)
    {
    lvi.iItem = i;
    lvi.lParam = i;
    m_List.InsertItem(&lvi);
    }
    }






  3. #3
    Join Date
    May 1999
    Location
    Canada
    Posts
    36

    Re: CListCtrl update

    IF the number of rows did not change then it is only a matter of invalidateing what needs to be updated.
    Do the following to only redraw the rect of the row that needs to be

    m_List.GetItemRect(row, &rect, LVIR_BOUNDS);
    InvalidateRect(&Rect);






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured