benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

ComboBox Set Property

Hi All,

I would like to set a seperate property when a combobox item has been selected.

In real terms, this means I would like to set the value of a textbox dependant on what a user selects from a dropdown.

Thanks,
Ben
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: ComboBox Set Property

Hi,

I've attached a small example for what you need. After downloading and extracting the archive copy the "combo.txt" file on drive C:\. After which you can build the .aip file and test the script.

Please note that in the Dialogs page, on the ComboBoxDemoDlg dialog you have a combobox and a static text field. You can see that MY_COMBO property attached to the combobox list is also the property of the static text field. Also the "Text" field attached to the static text has the value [MY_COMBO]. This will allow the static text to display the value depending on the combobox selection.

Some other informations about using comboboxes can be found here.

Regards,
Bogdan
Attachments
example.zip
(80.57 KiB) Downloaded 745 times
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Re: ComboBox Set Property

Hmm.

Unfortunately I have a more advanced scenario. The combobox value is entirely seperate from the textbox value (and property).

Lets say the combobox represents "database server type" and has the options "SQL Server" and "Oracle".

When you select one of those options, I would like to set a "port" textbox with the values "1433" or "1521" dependant on the option selected.

Is this possible?

Thanks,
Ben
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: ComboBox Set Property

Hello,

A combo box entry has two parts, the Text part and the Value part. The solution Bogdan offered you involves storing the port numbers in the Value part. Nonetheless only the text part will be visible in the combo box.
I am afraid there is no alternative solution to this, since this is a limitation of Windows Installer.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
lesliehedzg
Posts: 13
Joined: Tue Jul 24, 2018 10:05 pm

Re: ComboBox Set Property

I need three static values ​​of text in my combo box, how can I do that?
Thank you
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: ComboBox Set Property

Hello,

You can see my reply from the "Combobox: Text vs. values" thread.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”