Changing text in several boxes at the same time during preview

Hi

I want to change more than one text when I let the user change a text when in preview mode.

I have my own dialog box for editing the text and it works very well for the current box when I click it,

but I want to add the same text (on a different page) to another box.

FindComponent finds the second box, but it's not updating the text.

Is this possible to do at all?


function TdmOavtale.FindMemo(AMemo : string; ARapport: TfrxReport): TfrxMemoView;

begin

 Result := TfrxMemoView(ARapport.FindComponent(AMemo));

end;


procedure TdmOavtale.frxOavtaleDblClickObject(Sender: TfrxView;

 Button: TMouseButton; Shift: TShiftState; var Modified: Boolean);

var

 x : TfrxMemoView;

 s : string;

begin

 if Sender.ClassName='TfrxMemoView' then

 begin

   x := (Sender as TfrxMemoView);

   if (x.Name<>'AvtOC1') and (x.Name<>'txtIfNo') then

   begin

     s := x.Text;

     if DlgInputMemo('Edit text','Text',s) then

     begin

      x.Text  := s;

      Modified := True;

     end;

     if x.Name='txtNameOA' then

     begin

       x := FindMemo('txtNameFA',FRapport);

       if Assigned(x) then

       x.Text := s; // The box is found and the text changes, but not the report in preview mode

     end;

   end;

 end;

end;

Comments

Leave a Comment