|
#1
|
|||
|
|||
|
Example: Using Send Message to Populate Listbox
I've seen some posts here where it has been stated the Listbox gets slow when there are a lot of items. Here is a way to populate the Listbox using a function I wrote that uses SendMessage (User32.dll function) to add the items to the Listbox.
I tried populating a Listbox with ListBox.AddItem with 5000 items. I killed the task after 4 minutes. Using this function, it took 6 seconds to add the 5000 items ![]() Enjoy! Last edited by Worm; 01-18-2007 at 02:07 PM. |
|
#2
|
||||
|
||||
|
It is also possible to add a wack of items quickly by first stopping the listbox from updating it's view until you're finished:
Code:
-- Stop listbox from updating
ListBox.SetUpdate("ListBox1", false);
-- Add 5000 items
min = 1; -- The number to start at
max = 5000; -- The number to stop at
for count=1, 5000 do
ListBox.AddItem("ListBox1", count, "");
end
-- Let the listbox update
ListBox.SetUpdate("ListBox1", true);
|
|
#3
|
|||
|
|||
|
That's faster yet!
Plus I just realized the function I posted doesn't work properly! It adds the item to the listbox, but you can't select them.... yikes! |
|
#4
|
||||
|
||||
|
Uh, Worm, let's QA these things a little better, eh?
...kidding... |
|
#5
|
|||
|
|||
|
Heee!
That's a definite. Although its very odd that the item shows in the listbox, yet won't select. Ya gotta give me that, right? I'm grabbin' here man, help a brother out, eh. |
|
#6
|
||||
|
||||
|
'Tis odd ... But my way is still better! mua ha ha ha ha ha ha ha!!!
|
|
#7
|
|||
|
|||
|
yup it is.
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Populate Listbox from External File | rbourbonnais | AutoPlay Media Studio 5.0 | 7 | 03-20-2006 06:59 AM |
| Send OK message | rhosk | AutoPlay Media Studio 5.0 | 12 | 11-23-2005 01:17 AM |
| Send message to another computer | Rene | AutoPlay Media Studio 5.0 | 0 | 06-02-2005 05:37 PM |
| INI file to populate a listbox | pjhiggins | AutoPlay Media Studio 5.0 | 17 | 05-04-2004 05:08 PM |
| Packages and If Statements | Medlir | Setup Factory 6.0 | 4 | 05-09-2002 04:51 PM |
All times are GMT -6. The time now is 03:38 AM.









Linear Mode

