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
- :
- Re: Dropdown list questions on InstallScript MSI
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
‎Jun 25, 2009
06:50 PM
Dropdown list questions on InstallScript MSI
Hi,
I am modifying an existing dropdown list control on a dialog, here are what I want to do:
1) Currently the dropdown list contains 3 string items (loaded from a string list), and one of them has been set as default (and visible). Now I want to make none of them as default, but instead put some texts like 'Select Me'.
2) I also want to force a valid selection, i.e. until users have selected one from the 3 items, the 'Next' button of the dialog would remain disabled.
How can I do them?
Here is the existing code about the control in the custom dialog:
Thanks,
PB
I am modifying an existing dropdown list control on a dialog, here are what I want to do:
1) Currently the dropdown list contains 3 string items (loaded from a string list), and one of them has been set as default (and visible). Now I want to make none of them as default, but instead put some texts like 'Select Me'.
2) I also want to force a valid selection, i.e. until users have selected one from the 3 items, the 'Next' button of the dialog would remain disabled.
How can I do them?
Here is the existing code about the control in the custom dialog:
case DLG_INIT:
// Get the handle to the dialog.
hDialog = CmdGetHwndDlg(szDialog);
// Create dropdown list.
listSomeCode = ListCreate(STRINGLIST);
ListAddString (listSomeCode,"TEST1",AFTER);
ListAddString (listSomeCode,"TEST2",AFTER);
ListAddString (listSomeCode,"TEST3",AFTER);
// Associate the dropdown list with the combo box.
CtrlSetList(szDialog,CTRL_ID_COMBO,listSomeCode);
if (szSomeCode = "") then
szDefault = "TEST1";
szSomeCode = szDefault;
else
szDefault = szSomeCode;
endif;
CtrlSetCurSel(szDialog,CTRL_ID_COMBO,szDefault);
....
Thanks,
PB
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 25, 2009
08:04 PM
I alternatively add 'Select Me' to the list and make it as default, so if there is no better way for it, this may work for question 1).
I can also force users to select a valid item from the list in order to enable 'Next' button. If not a valid one selected, I disable 'Next' button and make users to select again.
But the problem is that if I don't touch the dropdown list control in the dialog, the 'Next' will be enabled and users can go to next dialog.
How can I force users to do selection of the dropdown list before 'Next' is enabled?
Thanks,
PB
I can also force users to select a valid item from the list in order to enable 'Next' button. If not a valid one selected, I disable 'Next' button and make users to select again.
But the problem is that if I don't touch the dropdown list control in the dialog, the 'Next' will be enabled and users can go to next dialog.
How can I force users to do selection of the dropdown list before 'Next' is enabled?
Thanks,
PB
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 26, 2009
09:28 AM
You can use EnableWindow to enable and disable a control such as a button. (See the source for SdRegisterUser and others.) Perhaps set the default state of the Next button to disabled, and then enable it based on the list-box selection?
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)