This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- List box control doesn't populate
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 25, 2012
08:34 AM
List box control doesn't populate
Hi,
I have a listbox on a dialog. At design-time, I've added 3 entries to its items collection. However, when I hit the dialog when running setup.exe I don't see the items.
Do I need to set another property, or do I need to do some installscript to see the elements in my design-time items collection show up at run-time?
I just did some more tests and I'm seeing the same behavior on a Combo box as well.
Thanks,
Eric
I have a listbox on a dialog. At design-time, I've added 3 entries to its items collection. However, when I hit the dialog when running setup.exe I don't see the items.
Do I need to set another property, or do I need to do some installscript to see the elements in my design-time items collection show up at run-time?
I just did some more tests and I'm seeing the same behavior on a Combo box as well.
Thanks,
Eric
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 25, 2012
12:43 PM
hidenori wrote:
Have you checked the following article?
Populating List Boxes at Run Time
I saw that article, but didn't read it, since I don't want to populate my listbox at runtime, but rather at design time.
Is it possible to populate at design time, if not what's the Items property on the Listbox and Combobox for?
-Eric
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 25, 2012
01:10 PM
If you are authoring InstallScript dialogs, the Items setting does not apply to this type of the dialogs. You need to populate the items through InstallScript code. I filed the work order #IOA-000074184 so that the Items setting will be removed from the project types that use InstallScript dialogs.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 25, 2012
03:34 PM
hidenori wrote:
If you are authoring InstallScript dialogs, the Items setting does not apply to this type of the dialogs. You need to populate the items through InstallScript code. I filed the work order #IOA-000074184 so that the Items setting will be removed from the project types that use InstallScript dialogs.
Hidenori,
I'm following the example at http://kb.flexerasoftware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&externalId=installshield19helplib-helplibrary-FAQUIListboxhtm&sliceId=&docTypeID=DT_MACROVISIONHELPNET_1_1&dialogID=135145530&stateId=0%200%20135139770. I'm not clear on how I can control the number that is assigned to each entry in the list, is that possible? How would I know which entry my user picked? Also, how would I internationalize this? With the items collection, each string that I created was associated to a numeric value, this would not be the case when doing it programmatically.
Thanks,
Eric
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2012
08:59 AM
Hidori,
I tried just using hard-coded strings for now, like in the example. I have the following snippet now:
When I enter my dialog, I see a message box that says "Combo box count= 3", but I don't see anything show up in my combobox. I'm thinking that the CtrlSetList isn't working correctly.
-Eric
I tried just using hard-coded strings for now, like in the example. I have the following snippet now:
// control identifiers
#define BUTTON_NEXT 1306
#define BUTTON_BACK 1307
#define COMBO_BOX_ID 1308
prototype NUMBER MyDialogSetup();
function NUMBER MyDialogSetup()
NUMBER nReturn;
NUMBER nControl;
BOOL bDone;
STRING dialogName;
STRING szControl;
STRING szComboBoxVal;
LIST listItem;
STRING szcomboboxcount;
begin
dialogName = "MyDialog"
nReturn = EzDefineDialog(dialogName, ISUSER, "MyDialog", 0);
if(nReturn = DLG_ERR) then
MessageBox("error on exDefineDialog", INFORMATION);
endif;
listItem = ListCreate(STRINGLIST);
ListAddString(listItem, "Entry1", AFTER);
ListAddString(listItem, "Entry2", AFTER);
ListAddString(listItem, "Entry3", AFTER);
Sprintf(szcomboboxcount, "%d", ListCount(listItem));
MessageBox("Combo box count= " + szcomboboxcount, INFORMATION);
CtrlSetList("MyDialog", COMBO_BOX_ID, listItem);
When I enter my dialog, I see a message box that says "Combo box count= 3", but I don't see anything show up in my combobox. I'm thinking that the CtrlSetList isn't working correctly.
-Eric
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Sep 26, 2012
09:41 AM
Perhaps see the code on the "CtrlSetList Example" help topic. I seem to remember that you need to call CtrlSetList from inside the DLG_INIT case of your custom dialog processing loop. (And later, call CtrlGetCurSel sometime before you call EndDialog to get what the user selected.)