yuval
yuval

Reputation: 3088

Inno Setup: how to create a page with radio buttons and forms

How can I put radio buttons and forms on the same Inno Setup page?

I currently have 3 fields:

enter image description here

I would like a radio button over the first field (Company / Name) and the third field (Customer Code).

Once a radio button is clicked, it disables the fields that aren't related to it (meaning making them a little grayish and unclickable).

So is there a way to put radio buttons and fields on the same page?

Upvotes: 1

Views: 2732

Answers (1)

Martin Prikryl
Martin Prikryl

Reputation: 202282

Inno Setup is flexible enough to allow what you need. But to have such a complicated GUI, you have to program this completely, you cannot do with simple utility functions like you are using atm probably (like CreateInputQueryPage).

You need to create:

  • a new blank page using CreateCustomPage
  • add radio buttons (TRadioButton)
  • add input controls for all three forms
  • handle TRadioButton.OnClick event and enable/disable respective forms based on selected button.

For a general introduction, see Pascal Scripting: Using Custom Wizard Pages.


Though for a faster start, you can actually start with CreateInputQueryPage, and only add your radio buttons and layout the text boxes correctly. To access individual edit boxes and their labels, use TInputQueryWizardPage.Edits and TInputQueryWizardPage.PromptLabels.

For some examples, see:

Upvotes: 3

Related Questions