In DDT is possible add a string array for fill a combox (when control is created)
Is possible do with Firefly or SDK ?
DIM a() AS STRING
a(1)="item1"
a(2)="item2"
a(3)="item3"
CONTROL ADD COMBOBOX, hDlg, id&,a(), x, y, xx, yy [, [style&] [, [exstyle&]]] [[,] CALL callback]
Is this process more fast or efficient that FF_Combobox_AddString or COMBOBOX ADD STRING (DDT) ?
FF_COMBOBOX_ADDSTRING or COMBOBOX ADD STRING add each item one by one
but do not know if there is another way.
Israel
No, there is not other way, and DDT does not any magic: it just creates the control and then adds the strings of the array one by one.
If you already know what items you want to add, you can use the "(Custom)" property of the ComboBox control and enter them at design time rather than at run time.
Thanks for quick reply and great information...
Israel
Also found it interesting that Borje Hagsten posted in PB Forum an example which helps to reduce the time
deactivating the %WM_SETREDRAW before of loop with:
SendMessage HWND_RELEMP_COMBO2,%WM_SETREDRAW, 0, 0
and activating after of loop.
SendMessage HWND_RELEMP_COMBO2,%WM_SETREDRAW, 1, 0
http://www.powerbasic.com/support/pbforums/showthread.php?t=23612&highlight=%25WM_SETREDRAW (http://www.powerbasic.com/support/pbforums/showthread.php?t=23612&highlight=%25WM_SETREDRAW)
I was testing and with a array of 33453 elements I reduce time from 7 seconds to 4 seconds.
Israel