2

I have seen answers for capturing events from user-created controls on wizard pages, but how do you do it for controls created as a result of a call to CreateInputOptionPage?

For example:

InputOptionPage := CreateInputOptionPage (wpWelcome,
  'Options', 
  'Select your option',
  'Please choose from one of the three options below:'
  True, False);

InputOptionPage.Add ('Option 1') ;
InputOptionPage.Add ('Option 2') ;
InputOptionPage.Add ('Option 3') ;

will create an option page with a radio group on it. I don't intend selecting any of the options by default and want to force the user to do so. As a visual clue I want to gray out the "Next" button while none are selected.

How do I add an OnClick handler for the radio buttons?

4

2 に答える 2

2

Although not directly the same question, the answer I just provided to this question shows how to do this for a Check Box but it's identical for a radio box.

于 2011-05-03T13:44:07.543 に答える
2

Short extract from Robert Love's answer:

procedure YourControlClick(Sender: TObject);
begin
  MsgBox('yep', mbError, 0);
end;

YourControl.OnClick := @YourControlClick;

I.e. everything is similar to usual Delphi style except for @ symbol. Omitting it results in confusing "Invalid number of parameters" error during compile.

于 2014-10-24T14:29:33.240 に答える