View Full Version : My sweet combo box...
NewsArchive
12-11-2001, 12:00 AM
Hi,
I have a combo box on a custom dialog. I set the string list with
CtrlSetList.
How can I set a default text for this combo??? (CtrlSetText didn't work
with combo)
NewsArchive
12-11-2001, 12:00 AM
Something like this should work (replace the YOUR_* in the sample below
with your specific control and dialog Ids)...
HWND hwndDlg, hwndItem,hCtrl;
.......
hwndDlg = CmdGetHwndDlg( YOUR_DIALOG_ID );
hCtrl = GetDlgItem(hwndDlg, YOUR_ID_FOR_COMBOBOX);
nIndex = USER.SendMessageA(hCtrl, CB_FINDSTRING, -1,
"YourDefaultString");
SendMessage(hCtrl, CB_SETCURSEL, nIndex, 0);
--
Martin
InstallShield Software Corp.
"S.Kemal Durukan" <kemald@logo.com.tr> wrote in message
news:3c15cb78@news.installshield.com...
>
> Hi,
>
> I have a combo box on a custom dialog. I set the string list with
> CtrlSetList.
>
> How can I set a default text for this combo??? (CtrlSetText didn't
work
> with combo)
>
>
NewsArchive
12-11-2001, 12:00 AM
You might use CtrlSetCurSel.
"S.Kemal Durukan" <kemald@logo.com.tr> wrote in message
news:3c15cb78@news.installshield.com...
>
> Hi,
>
> I have a combo box on a custom dialog. I set the string list with
> CtrlSetList.
>
> How can I set a default text for this combo??? (CtrlSetText didn't
work
> with combo)
--
Robert Dickau
InstallShield Software Corp.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.