|
From: William Dauchy on 14 May 2008 05:38 Hello, I have a CComboBox. I wanted to modify the text of one entry. So I made: myCComboxBox.SetDlgItemText(mySel, "Some new text"); But nothing changed. What I missed? Regards, -- William
From: Giovanni Dicanio on 14 May 2008 05:50 "William Dauchy" <wdauchy(a)gmail.com> ha scritto nel messaggio news:2ce5b9bb-012e-48a5-a188-4d22b6175236(a)m73g2000hsh.googlegroups.com... > I have a CComboBox. I wanted to modify the text of one entry. > So I made: > > myCComboxBox.SetDlgItemText(mySel, "Some new text"); > > But nothing changed. You may try to call CComboBox :: DeleteString to remove the old string, and InsertString to add the new one... BTW: CodeProject has a tutorial on Combo-boxes: http://www.codeproject.com/KB/combobox/combobox_tut.aspx Giovanni
From: William Dauchy on 14 May 2008 06:17 On May 14, 11:50 am, "Giovanni Dicanio" <giovanni.dica...(a)invalid.com> wrote: > You may try to call CComboBox :: DeleteString to remove the old string, and > InsertString to add the new one... Yup I know, but I was looking for a way to modify it... (because of the place in the list...) I will check this tuto. -- William
From: William Dauchy on 14 May 2008 06:27 On May 14, 12:17 pm, William Dauchy <wdau...(a)gmail.com> wrote: > Yup I know, but I was looking for a way to modify it... (because of > the place in the list...) Yup it can be done with InsertString. But I just don't understant why SetDlgItemText isn't working. -- William
From: Giovanni Dicanio on 14 May 2008 06:55
"William Dauchy" <wdauchy(a)gmail.com> ha scritto nel messaggio news:2f84e653-8482-463f-b9fe-038999deb77b(a)m44g2000hsc.googlegroups.com... > Yup it can be done with InsertString. But I just don't understant why > SetDlgItemText isn't working. It depends on how the API was designed... I think that to modify a string in a combo-box entry you should specify two parameters: the string position (index in combo-box), and the new string value. SetDlgItemText only gets string value as parameter, you can't specify the string index into combo-box. Giovanni |