itslittlejohn
itslittlejohn

Reputation: 1878

Hide edit control when checkbox is checked in windows installer dialog

I have a dialog box with a checkbox and two edit fields beneath it. I want the edit fields to be grayed out or disabled as soon as the checkbox is checked. I know this is possible by adding an entry to the ControlCondition table in the MSI, but I don't know what to use for the Condition and I can't find any examples with checkboxes for windows installer.

I know I'm close. Any ideas?

EDIT: I am trying to do this in an installer project, so I don't have access to the Dialog code directly. Instead I'm trying to edit the Dialog in an MSI editor like Orca.

Upvotes: 3

Views: 2372

Answers (2)

itslittlejohn
itslittlejohn

Reputation: 1878

Alright I figured it out. I was closer than I thought!

Using Orca, I had a checkbox called Checkbox1 with Property set to USEWINAUTH.

Now, in the ControlCondition table, I added 4 entries:

Dialog_: CustomTextA
Control_: Edit2
Action: Disable
Condition: USEWINAUTH=1

Dialog_: CustomTextA
Control_: Edit2
Action: Enable
Condition: USEWINAUTH<>1

And then repeat for the other Edit control.

I'll end up doing this with a script so I don't have to edit the MSI by hand with Orca every time I build the project.

Upvotes: 1

hemlocker
hemlocker

Reputation: 1052

can you just set their Visible attribute to false? Or hell, just set the Enabled attribute to false.

Upvotes: 0

Related Questions