在Fastreport编辑器中获取所选组件?

问题描述 投票:0回答:1

有没有办法获取用户在报表编辑器上选择的对象/组件?我的意思是,Delphi应用程序是否有任何方法可以知道选择了哪个项目/对象/组件?

例如,如果我点击TfrxMemoView或TfrxPictureView,我希望我的Delphi应用程序识别该对象,以便您可以使用它,这样的事情......

myMemo := myDesigner.getSelected;

要么

myMemo := myReport.getSelected;

我正在使用FastReports VCL 6。

如果你知道如何实现它会非常有帮助。

delphi vcl fastreport
1个回答
0
投票

好吧,如果你需要按照我的需要做同样的事情,我设法这样做:

for I := 0 to Report.Designer.SelectedObjects.Count - 1 do
    begin
     ShowMessage(TfrxComponent(Report.Designer.SelectedObjects.Items[i]).Name);
      if TfrxComponent(Report.Designer.SelectedObjects.Items[i]) is TfrxMemoView then
       begin
         TfrxMemoView(Report.Designer.SelectedObjects.Items[i]).Align:= baLeft;
         Report.Designer.ReloadObjects();{to refresh the designer as it was embedded in a panel and I wanted to change components properties on "realtime"}
       end;
    end;
© www.soinside.com 2019 - 2024. All rights reserved.