Is there a way I can dynamically add and remove data items to the list box part of a combo box from within an application?
many thanks Bazz
Printable View
Is there a way I can dynamically add and remove data items to the list box part of a combo box from within an application?
many thanks Bazz
You can use SendMessage or SendDlgItemMessage(if you are using a dialogbox)
example:
SendDlgItemMessage(hDlg,IDC_COMBO,CB_ADDSTRING,0,( LPARAM)text);
and to select the default value you can use
SendDlgItemMessage(hDlg,IDC_COMBO,CB_SELECTSTRING,-1,(LPARAM)text);
hope this helps