Hey oliver,
>There is a database and it is contain a 10000 record. If I put it all to the List Box Object. How can I to speed-up the perforamce?
A 10,000 record list box is pretty hefty!! Do all 10,000 records have to be in the list? Notice I said "in the list", I didn't say "available".
What you might do is devise some sort of filtering criteria the user could use to load only specific records in the list. For example, say you wanted customer names in the list. What you could do is build a row of 3 command buttons. The first with "A - H" on it, the second with "I - P" and the third with "Q - Z".
Behind each of the buttons use code something like
SELECT last, first FROM CUSTOMER WHERE BETWEEN(LEFT(last,1),"A","H") ;
ORDER BY last, first INTO CURSOR temp
THISFORM.lstnames.Refresh()
If you sent the RowSourceType of the list to 2 - Alias and set the RowSource to Temp you will dramatically reduce the number of records in the list.
A few notes here...I'd add a USE IN TEMP in the Destroy of the listbox...In the init of the form is where I'd set the RowSource of the list to Temp.
Off the top of my head, that should get you started.
Hth,
Jim Duffy
Microsoft MVP
INETA Speaker
TakeNote TechnologiesDeveloper's Choice Award Winner for Best Training Company
Specializing in VB.NET, ASP.NET, VFP, and SQL Server Training and Development