Interaction with controls

Top  Previous  Next

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:




procedure CheckBox1OnClick(Sender: TfrxComponent);


 Button1.Enabled := not CheckBox1.Checked;



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.