Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Retrieve the value of ListBox

Hello,

I know that the value of the listbox takes the value of the selection in the control data, but how do I get that value to show itself in text form? I have a listbox with, let's say, Option1 and Option2. Then at the bottom it'll say in static text

Your selection is: [value]

where the [value] is what the user selected. If the user highlights Option1, then it'll say

Your selection is: Option 1

I've tried setting the text display to the property name of the ListBox, and it worked, but only if I force a 'refresh' by going to the previous dialogue and then returning to the ListBox dialogue.

Thanks.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Retrieve the value of ListBox

Hello,

Please keep in mind this is the default Windows Installer behavior. However, in order to achieve what you want you can use a static text control (having the same associated property as your list box control) like this:
  • Text: [LISTBOX_PROP]
    Property Name: LISTBOX_PROP
Here's attached a sample, created using version 9.8 of Advanced Installer, which implements a similar scenario.
sample.zip
(2.75 KiB) Downloaded 489 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Re: Retrieve the value of ListBox

Daniel.Radu wrote:Hello,

Please keep in mind this is the default Windows Installer behavior. However, in order to achieve what you want you can use a static text control (having the same associated property as your list box control) like this:
  • Text: [LISTBOX_PROP]
    Property Name: LISTBOX_PROP
Here's attached a sample, created using version 9.8 of Advanced Installer, which implements a similar scenario.
sample.zip
Let us know if this helped.

All the best,
Daniel
Oh I forgot to mention. I was using the skin "Surface."

On the classic theme it seems to work fine, with instantaneous updates as you select he options in the ListBox. But in Surface, this doesn't appear to happen. Is this just a limitation of the theme?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Retrieve the value of ListBox

Hello,

I've tested your scenario, but I cannot reproduce the behavior. Here's attached a sample, created with version 9.9 of Advanced Installer, which implements a similar scenario.
sample.zip
(4.97 KiB) Downloaded 500 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Searcher64
Posts: 19
Joined: Sun Jan 22, 2012 3:29 am

Re: Retrieve the value of ListBox

Daniel.Radu wrote:Hello,

I've tested your scenario, but I cannot reproduce the behavior. Here's attached a sample, created with version 9.9 of Advanced Installer, which implements a similar scenario.
sample.zip
Let us know if this helped.

All the best,
Daniel
Sorry for the late reply.

That's quite strange. It works on the sample, but not on the project. May I send the project file to your support e-mail?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Retrieve the value of ListBox

Hello,

Yes, please send us your .AIP (project file) support at advancedinstaller dot com so we can investigate it.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”