Sorry for this post, I feel very stupid :stupid:

I've tried many configuration of my combobox and many message, but this is always the same.

The combox works well, and I can see the strings I send with CB_ADDSTRING but there's nothing shown in the dialog box when i don't press the little arrow. I want the first Item in the combobox without doing anything.

invoke GetDlgItem,hWin,IDC_CBSTYLE
mov CBSTYLE_H,eax

;display strings in combobox
invoke SendMessage,CBSTYLE_H,CB_ADDSTRING,0,addr Combostring1 ;string: "ASM"
invoke SendMessage,CBSTYLE_H,CB_ADDSTRING,0,addr Combostring2 ; string:"C/C++"
invoke SendMessage,CBSTYLE_H,CB_ADDSTRING,0,addr Combostring3 ; string: "Delphi"

at startup my combobox is empty (not exactly, but the items are on the list):

and if I press the little arrow I can see my strings:

What I have to do to make the first item (eg: "Asm") in the combobox at startup and not leave the combox blank ? (I want the string to be as default if you prefer...)

I don't understand what i missing in my combobox configuration...

Thank you very much. Sorry but I've tried and searched, and nothing comes...

Regards, Neitsa.
Posted on 2004-04-01 17:56:38 by Neitsa
invoke SendMessage, CBSTYLE_H, CB_SETCURSEL, 0, 0
Posted on 2004-04-01 19:29:16 by donkey
This works also:

invoke SendMessage, [handle_of_ComboBox], WM_SETTEXT, 0, ADDR szTextToDisplay

to write a text as default.
Posted on 2004-04-02 04:36:32 by Apprentice

Hum...I wish to thank both of you.

Well I think that from now on, I'll not try to work on my programs when it's late or when i'm tired. It doesn't make my mind and ideas clearer... :sweat:

Thank you very much, I'll try to sleep before asking questions like this one ;)

Regards, Neitsa.
Posted on 2004-04-02 06:59:08 by Neitsa