I have a special combo box generated from DevExpress TdxfCustomComboBox. It works very well in most cases ... and then I got a message from the client that when they try to open it, it takes 3 seconds for the popup. After a little investigation, I found out that this is because their database contains about 12,000 items that she is trying to fill in, and she recreates the popup and populates it every time.
This means that StdCtrls.TListBoxStrings.Addwhich contains this line gets 12,000+ times, once for each line.
SendMessage(ListBox.Handle, LB_ADDSTRING, 0, Longint(PChar(S)));
Processing this line requires several trips through several layers of message handlers and really scares things. I find this stupid, since only about a dozen elements are actually displayed in a pop-up window at the same time. Does anyone know a list control that does not require this kind of preload and can scale?
EDIT: Unfortunately, 12,000 items are not loading for this. The number of elements in the combo box depends on the number of elements in the database, and all of them must be available. None of them turns it into anything other than a combined field. Screen real estate is not enough for this.
source
share