|
-
Dec 15th, 2006, 07:53 AM
#1
Thread Starter
Hyperactive Member
ComboBox and method to a very speed loading of the data
Hi All
Like in a title. For the load e.g. 2000 records
Someone know?
Thanks in advance
I know, I know, my English is bad, sorry .....
-
Dec 15th, 2006, 07:59 AM
#2
Re: ComboBox and method to a very speed loading of the data
VB Code:
' in a module
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_INITSTORAGE = &H161
Public Sub ComboInitStorage(ByRef ComboBox As Object, ByVal Items As Long, ByVal ItemSizeEstimate As Long)
SendMessage ComboBox.hwnd, CB_INITSTORAGE, Items, ByVal (Items * ItemSizeEstimate)
End Sub
Example:
VB Code:
Private Sub Command1_Click()
' init space for 2000 items reserving 50 bytes per item
ComboInitStorage Combo1, 2000, 50
' then add code to fill the combobox...
End Sub
Last edited by Merri; Dec 15th, 2006 at 08:08 AM.
-
Dec 19th, 2006, 05:05 AM
#3
Thread Starter
Hyperactive Member
Re: ComboBox and method to a very speed loading of the data
Thanks Merri, unfortunatelly it not help me
It’s still slowly.
I know, I know, my English is bad, sorry .....
-
Dec 19th, 2006, 05:53 PM
#4
Re: ComboBox and method to a very speed loading of the data
Have you also tried setting Visible = False while you're loading the data and then True once you're done?
Is the code you use to add the items very straightforward and simple or does it have more complexity than just a simple add within a loop?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|