05-28-2015, 05:58 PM
To select combo box items using a variable, call CB_SelectItem or CB_SelectString in dialog procedure, under case WM_INITDIALOG.
Or before ShowDialog insert & in the dialog variable. This function makes it easier.
Function CB_InitDialogVariable
Macro Macro2571
Or before ShowDialog insert & in the dialog variable. This function makes it easier.
Function CB_InitDialogVariable
;/
function str&cbVar selItem [$items]
;Formats cbVar to be passed to ShowDialog as a combo box variable.
;Inserts & depending on selItem.
;cbVar - combo box variable. Should not have lines that begin with &.
;selItem - 0-based item index.
;items - if used, adds to cbVar (then cbVar can be empty).
if(!empty(items)) cbVar.addline(items)
if(selItem<0) ret
selItem=findl(cbVar selItem); if(selItem<0) ret
cbVar.insert("&" selItem)