O my God, Embarcadero has made a mistake.
A few tests of mine showed that if the check-box initially is unchecked, but is checked by the user, then the tfVerificationFlagChecked
flag will be set. But if the flag is initally set, and the user unchecks the box, then tfVerificationFlagChecked
will not be removed from the Flags
set. And this is not strange. The VCL code does
Result := TaskDialogIndirect(LTaskDialog, {$IFNDEF CLR}@{$ENDIF}LModalResult,
{$IFNDEF CLR}@{$ENDIF}LRadioButton, {$IFNDEF CLR}@{$ENDIF}LVerificationChecked) = S_OK;
FModalResult := LModalResult;
if Result then
begin
FButton := TTaskDialogButtonItem(FButtons.FindButton(FModalResult));
FRadioButton := TTaskDialogRadioButtonItem(FRadioButtons.FindButton(LRadioButton));
if LVerificationChecked then
Include(FFlags, tfVerificationFlagChecked);
end;
Notice that the flag is included if the checkbox is checked when the dialog closes, but there is no code to remove the flag if the box is unchecked by the user.
Of course, one would expect the latter part of the code to have read
if LVerificationChecked then
Include(FFlags, tfVerificationFlagChecked)
else
Exclude(FFlags, tfVerificationFlagChecked)
I think I'll go with the OnVerificationClicked
manual toggling approach.