Click here to Skip to main content
15,881,559 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
1. I want to make a scrolling listctrl, so do not use next-screen button or previous-screen button.

2. In the listctrl screen, for example:
- If there are 10 rows to display
- In the program, I move the values to the listCtrl variables (insertItem, setItemText)
- After moving the values to all 10 rows, the screen display at using "UpdateData(FALSE)"
- So, there is a somehow time interval to display data.
- Question: How can I show the each record to the screen not using one time display of 10 rows.

Thank you

What I have tried:

I wasted 1 month to solve the above problem. God bless me!
Posted
Updated 14-Apr-16 1:42am
Comments
Richard MacCutchan 14-Apr-16 3:26am    
It is difficlt to understand what your problem is. Are you using the MFC CListCtrl?

1 solution

It is not quite clear what you are looking for but I will try to answer.

If you want to make updating the list items faster, you can disable redrawing while inserting and changing items:
// Disable redrawing while updating the list
SetRedraw(FALSE);
// Add or update items here
SetRedraw(TRUE);


A CListCtrl has scrolling enabled by default. Besides user interaction with the scroll bars and arrow / page keys you can also scroll programmatically using CListCtrl::Scroll[^]. Note that this expects pixel values but scrolls vertically only by full lines. So you have to pass the number of lines multiplied by the line height.

If you only want to ensure that a specific row is visible you can use CListCtrl::EnsureVisible[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900