Home > Software engineering >  CListBox more than 70000 or so, the scroll bar is not working
CListBox more than 70000 or so, the scroll bar is not working

Time:10-11

Such as title, to a CListBox insert after more than 70000, the scroll bar is bad to use, to use at the bottom of the debug and release is bad to use, a scroll bar can't drag, according to the expected position
Have a great god know what causes and solutions,
Flip the methods don't avoid this problem, help mm genuflect is begged

CodePudding user response:

http://www.codeguru.com/cpp/controls/listview/dragdrop/article.php/c16161/Overcome-Window-Flicker-While-Dragging.htm

CodePudding user response:

7 w to you empty the AddString again next content

CodePudding user response:

First of all thank you upstairs to reply, but I'm not particularly understand, below is my test code,
//CListBox m_List; 
for(int i=0; i <100000; I++)
{
Char szMsg [32].
Memset (szMsg, 0, 32);
_snprintf (szMsg, 31, "% d", I);
Int nindex=m_List. AddString (cstrings (szMsg));
ASSERT (nindex==I);
}

CodePudding user response:

Article as long as the number does not exceed the maximum value, there is no problem, the problem is, don't want to change the plan, to turn pages, or delete data that solve, can only go forward

CodePudding user response:

@ paschen
Position is not flashing, this phenomenon is the scroll bar can't move, look in the list of values or feeling,
Feelings and is not a problem, the article said always feel is a variable in the CListBox crossing the line, but the code and don't go in

CodePudding user response:

or you use 2 ListBox is greater than 7 w to show with another

CodePudding user response:

Whether can try to CListCtrl controls?
With this control can only use a column and column headings hidden, the effect should be similar to CListBox,

CListCtrl can use virtual list, so its UI interaction does not feel any lag, I use it about seven, eight columns, the number of 1500 w is no problems
So you also too won't big changes

CodePudding user response:

Then use the CListCtrl, can use a virtual list

http://blog.chinaunix.net/uid-20617446-id-79386.html

CodePudding user response:

Is there any know what cause this phenomenon?

CodePudding user response:

WM_VSCROLL
See the MSDN, location information saved in the 2 bytes, so up to 65536
Some code even use this as a symbol of the data, may be only 32768

CodePudding user response:

http://download.csdn.net/detail/zhao4zhong1/7610833

CodePudding user response:

Don't will not turn back to lose
This time can be at ease back to custom painting

Save the data and display are two different things
Your screen again cattle B, also showed only two or three of article 10 records
According to the total amount according to in a short period of

Flip just move backwards and forwards 23 ten records only the beginning and end of the pointer

CodePudding user response:

What is virtual list are pulled chicken and egg thing
Defy spirit to try again

CodePudding user response:

Vc6
Char szMsg [32].
for(int i=0; i <100000; I++)
{
Memset (szMsg, 0, 32);
30 sprintf (szMsg, "% d", I);
Int index=m_ListBox. AddString (szMsg);
If (LB_ERRSPACE==index) AfxMessageBox (" No enough Space!" );
}
No problem!!!!!!

CodePudding user response:

Vc6 Windows 7
//TODO: Add extra initialization here
Char szMsg [32].
for(int i=0; i 600000; I++)
{
Memset (szMsg, 0, 32);
30 sprintf (szMsg, "% d", I);
Int index=m_ListBox. AddString (szMsg);
If (LB_ERRSPACE==index)
{
AfxMessageBox (" No enough Space!" );
AfxDump & lt; break;
}
}
Or no problem
  • Related