By using a script, complex logic can be incorporated into a dialogue's operation. Let's illustrate this with a simple example : modify the form like this:
Double-click on the “CheckBox” object to create an “OnClick” event handler and enter the following script:
PascalScript:
procedure CheckBox1OnClick(Sender: TfrxComponent);
begin
Button1.Enabled := not CheckBox1.Checked;
end;
C++ Script:
void CheckBox1OnClick(TfrxComponent Sender)
{
Button1.Enabled = !CheckBox1.Checked;
}
This code is the same as is used in Delphi. On running the report the button responds to the state of the check box.
|