golf4r
Posts: 11
Joined: Tue Feb 24, 2015 11:56 pm

CheckBox that will make appear or disappear elements

Hi,

I am trying to have a checkbox that would , when checked, make appear several other elements in the same Dialog.

The other elements are not in the same "group" but I guess there is a way to arrange a bunch of elements so they can get visible and invisible all together at the same type at the checkbox state change ?

Thanks
Dan
Posts: 4529
Joined: Wed Apr 24, 2013 3:51 pm

Re: CheckBox that will make appear or disappear elements

Hi,
I am trying to have a checkbox that would , when checked, make appear several other elements in the same Dialog.
Through the Edit Control Condition Dialog you can apply different actions on the related elements.

When the checkbox is enabled, the property assigned to the related checkbox control is set (by default the property of a checkbox is CHECKBOX_1_PROP). When the checkbox is disabled, the property is empty.

Assuming that you would have am edit field which will be visible when the chebox is enabled and hidden when the chebox is disabled, you should have the following control condition for the related edit field control.
  • Condition: CHECKBOX_1_PROP
    Action: Show
  • Condition: NOT CHECKBOX_1_PROP
    Action: Hide
The sample project is attached to this thread, so if you are interested to take a look directly at my project, you are more than welcome to download the ZIP file.

Best regards,
Dan
Attachments
ControlConditionUI.zip
(2.95 KiB) Downloaded 245 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
golf4r
Posts: 11
Joined: Tue Feb 24, 2015 11:56 pm

Re: CheckBox that will make appear or disappear elements

Hey Dan,


Thanks for the quick answer, I got it working.

I thought that with having the ComboBox invisble and disabled with pressing the checkbox, the info linked to the ComboBox would not appear in the further steps.

Let me explain:

I have a SettingsDlg and in this, I have 3 combo box... Server, Proxy 1 and Proxy 2. Proxy 2 is optional and only showed upon pressing the checkbox ( this part works flawlessly , thanks to you ).

What this settingsDLG does to is gathering information about Server, Proxy1 and Proxy2 and sets it into vars that will be used later in Files and Folders to do a search and replace of strings ... now what it does , it sets the Proxy=proxy1:port,proxy2:port no matter if the proxy 2 is disabled .... there is a , between the 2 proxy in the replace file that needs to go too if there is only 1 proxy ... I was looking to implement some IF condition but I am not sure I am looking the right way ... would it be possible to call many TXT Update Set depending on if Proxy2 is enabled or disabled ? something like that ?

Thanks

Return to “Building Installers”